aboutsummaryrefslogtreecommitdiff
path: root/.venv/lib/python3.12/site-packages/past/builtins/__init__.py
diff options
context:
space:
mode:
authorS. Solomon Darnell2025-03-28 21:52:21 -0500
committerS. Solomon Darnell2025-03-28 21:52:21 -0500
commit4a52a71956a8d46fcb7294ac71734504bb09bcc2 (patch)
treeee3dc5af3b6313e921cd920906356f5d4febc4ed /.venv/lib/python3.12/site-packages/past/builtins/__init__.py
parentcc961e04ba734dd72309fb548a2f97d67d578813 (diff)
downloadgn-ai-master.tar.gz
two version of R2R are hereHEADmaster
Diffstat (limited to '.venv/lib/python3.12/site-packages/past/builtins/__init__.py')
-rw-r--r--.venv/lib/python3.12/site-packages/past/builtins/__init__.py72
1 files changed, 72 insertions, 0 deletions
diff --git a/.venv/lib/python3.12/site-packages/past/builtins/__init__.py b/.venv/lib/python3.12/site-packages/past/builtins/__init__.py
new file mode 100644
index 00000000..1b19e373
--- /dev/null
+++ b/.venv/lib/python3.12/site-packages/past/builtins/__init__.py
@@ -0,0 +1,72 @@
+"""
+A resurrection of some old functions from Python 2 for use in Python 3. These
+should be used sparingly, to help with porting efforts, since code using them
+is no longer standard Python 3 code.
+
+This module provides the following:
+
+1. Implementations of these builtin functions which have no equivalent on Py3:
+
+- apply
+- chr
+- cmp
+- execfile
+
+2. Aliases:
+
+- intern <- sys.intern
+- raw_input <- input
+- reduce <- functools.reduce
+- reload <- imp.reload
+- unichr <- chr
+- unicode <- str
+- xrange <- range
+
+3. List-producing versions of the corresponding Python 3 iterator-producing functions:
+
+- filter
+- map
+- range
+- zip
+
+4. Forward-ported Py2 types:
+
+- basestring
+- dict
+- str
+- long
+- unicode
+
+"""
+
+from future.utils import PY3
+from past.builtins.noniterators import (filter, map, range, reduce, zip)
+# from past.builtins.misc import (ascii, hex, input, oct, open)
+if PY3:
+ from past.types import (basestring,
+ olddict as dict,
+ oldstr as str,
+ long,
+ unicode)
+else:
+ from __builtin__ import (basestring, dict, str, long, unicode)
+
+from past.builtins.misc import (apply, chr, cmp, execfile, intern, oct,
+ raw_input, reload, unichr, unicode, xrange)
+from past import utils
+
+
+if utils.PY3:
+ # We only import names that shadow the builtins on Py3. No other namespace
+ # pollution on Py3.
+
+ # Only shadow builtins on Py3; no new names
+ __all__ = ['filter', 'map', 'range', 'reduce', 'zip',
+ 'basestring', 'dict', 'str', 'long', 'unicode',
+ 'apply', 'chr', 'cmp', 'execfile', 'intern', 'raw_input',
+ 'reload', 'unichr', 'xrange'
+ ]
+
+else:
+ # No namespace pollution on Py2
+ __all__ = []