Server IP : 85.214.239.14 / Your IP : 13.58.232.94 Web Server : Apache/2.4.62 (Debian) System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64 User : www-data ( 33) PHP Version : 7.4.18 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : OFF | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : OFF Directory : /srv/modoboa/env/lib/python3.5/site-packages/past/builtins/ |
Upload File : |
""" 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__ = []