Home
last modified time | relevance | path

Searched refs:Py2 (Results 1 – 25 of 354) sorted by relevance

12345678910>>...15

/dports/devel/py-future/future-0.18.2/docs/
H A Dutilities.rst7 backward compatibility with Py2 in the :mod:`future.utils` and
9 from ``six`` and various home-grown Py2/3 compatibility modules from popular
16 # Functions like print() expect __str__ on Py2 to return a byte
17 # string. This decorator maps the __str__ to __unicode__ on Py2 and
32 # Iterators on Py3 require a __next__() method, whereas on Py2 this
34 # identically on Py2:
H A Dfuturize_cheatsheet.rst6 How to convert Py2 code to Py2/3 code using ``futurize``:
16 …all the package with ``python setup.py install`` and run its test suite on Py2.7 (e.g. ``python se…
24 Step 1: modern Py2 code
41 **1d**. Re-run the test suite on Py2 and fix any errors.
72 Step 2: working Py3 code that still supports Py2
75 The goal for this step is to get the tests passing first on Py3 and then on Py2
89 These will likely require imports from ``future`` on Py2 (and sometimes on Py3),
104 All strings in the module would then be unicode on Py2 (as on Py3) unless
121 After each change, re-run the tests on Py3 and Py2 to ensure they pass on both.
H A Droadmap.rst7 1. "Safe" mode -- from Py2 to modern Py2 or Py3 to more-compatible Py3
10 - Safe is highly unlikely to break existing Py2 or Py3 support. The
16 - Bold might make assumptions about which strings on Py2 should be
20 interfaces on Py2 and Py3 accept unicode strings versus
H A Dwhatsnew.rst79 ``ConfigParser`` on Py2 to improve compatibility with the backported
101 - Add missing ``cmp_to_key`` for Py2.6. (Issue #189)
115 - Fix ``socket.create_connection()`` backport on Py2.6 (issue #162)
125 - Use 3-argument ``socket.create_connection()`` backport to restore Py2.6
137 This release fixes compatibility bugs with CherryPy's Py2/3 compat layer and
139 backports for Py2.6 and Py2.7 from Py3.4's standard library.
145 of ``urllib`` on Py2. This implies, for example, that
151 - Backport of ``itertools.count`` for Py2.6 (issue #152)
154 - Backport of ``reprlib.recursive_repr`` to Py2
163 - Improve robustness of test suite against opening .pyc files as text on Py2
[all …]
H A Dlimitations.rst1 limitations of the ``future`` module and differences between Py2 and Py3 that are not (yet) handled
17 Py2 to Py2/3.
48 - Ensure you are using new-style classes on Py2. Py3 doesn't require
49 inheritance from ``object`` for this, but Py2 does. ``pasteurize``
H A Dopen_function.rst13 On Py2 with ``future`` installed, the :mod:`builtins` module provides an
16 available in the standard library :mod:`io` module on Py2.7.
23 need the returned data to behave the exactly same way on Py2 as on Py3, you can
30 # On Py2, data is a standard 8-bit str with loose Unicode coercion.
H A Dfuturize_overview.rst9 import ConfigParser # Py2 module name
14 def next(self): # Py2-style iterator interface
22 print letter, # Py2-style print statement
24 into this code which runs on both Py2 and Py3:
H A Dstr_object.rst14 Py2 having a ``u'...'`` prefix, versus simply ``'...'``, and the removal of
25 On Py2, this gives us::
32 Then, for example, the following code has the same effect on Py2 as on Py3::
52 permitted on Py2 with the :class:`newstr` class even though they
69 .. For example, this is permissible on Py2::
79 In most other ways, these :class:`builtins.str` objects on Py2 have the
H A Dautomatic_conversion.rst3 Automatic conversion to Py2/3
8 both platforms (Py2/3) using the :mod:`future` module. These are based on
15 For conversions from Python 3 code to Py2/3, use the ``pasteurize`` script
H A Dpasteurize.rst3 ``pasteurize``: Py3 to Py2/3
15 into this code which runs on both Py2 and Py3::
35 alias. To use the resulting code on Py2, install the ``configparser`` backport
H A Dbytes_object.rst7 of the most difficult tasks in writing a Py2/3 compatible codebase. This
20 On Py3, this is simply the builtin :class:`bytes` object. On Py2, this
53 in a Py2/3 codebase is to wrap all byte-string literals ``b'...'`` in a
66 and Py2 strings.
H A Dfuturize.rst3 ``futurize``: Py2 to Py2/3
25 up-to-date without breaking Py2 compatibility. The resulting code will be
127 ``next(obj)``, which is Py2/3 compatible, but doesn't change any ``next`` method
128 names to ``__next__``, which would break Py2 compatibility.
168 Stage 2: Py3-style code with wrappers for Py2
261 lib2to3.fixes.fix_future # Removing __future__ imports is bad for Py2 compatibility!
264 lib2to3.fixes.fix_metaclass # Causes SyntaxError in Py2! Use the one from ``six`` instead
293 (byte-strings on Py2, unicode strings on Py3).
H A Dchangelog.rst17 - Fix ``OrderedDict.clear()`` on Py2.6 (Issue #125)
45 exists on Py2 (Issue #109)
67 >>> # Alias for future.builtins on Py2:
70 >>> # Alias for future.moves.* on Py2:
99 from collections import Counter, OrderedDict # backported to Py2.6
335 ``newobject`` defines other Py2-compatible special methods similarly:
569 The ``pasteurize`` script for converting from Py3 to Py2/3 still adds
652 ``input()`` no longer disabled globally on Py2
941 * Restore Py2.6 compatibility
1013 * We no longer disable obsolete Py2 builtins by default with ``from
[all …]
H A Dcustom_str_methods.rst7 functions like ``print()`` expect ``__str__`` on Py2 to return a byte
11 Py2 and define ``__str__`` to encode it as utf-8::
H A Dquickstart.rst61 form compatible with both Py3 and Py2. Most remaining Python 3 code should
94 from collections import ChainMap # even on Py2.7
132 Then add the following code at the top of your (Py3 or Py2/3-compatible)
150 For more information about writing Py2/3-compatible code, see:
H A Dcompatible_idioms.rst204 "Old division" (i.e. compatible with Py2 behaviour):
215 a = old_div(b, c) # always same as / on Py2
250 from builtins import int # subclass of long on Py2
468 # To make Py2 code safer (more like Py3) by preventing
510 for key in heights.values(): # efficient on Py2 and Py3
602 itemlist = list(heights.items()) # inefficient on Py2
629 def next(self): # Py2-style
635 assert itr.next() == 'H' # Py2-style
695 print(a) # prints string encoded as utf-8 on Py2
763 mylist = list(range(5)) # copies memory on Py2
[all …]
/dports/devel/py-future/future-0.18.2/
H A DREADME.rst13 either Py2 or Py3 code easily to support both Python 2 and 3 in a single
30 versus Py2
33 their Python 3 names on Py2
115 # input() replaces Py2's raw_input() (with no eval()):
122 # Compatible output from isinstance() across Py2/3:
144 # Many Py3 module names are supported directly on both Py2.x and 3.x:
150 # Refactored modules with clashing names on Py2 and Py3 are supported
161 from collections import Counter, OrderedDict # backported to Py2.6
164 Automatic conversion to Py2/3-compatible code
176 For conversions from Python 3 code to Py2/3, use the ``pasteurize`` script
[all …]
/dports/lang/cython/Cython-0.29.24/tests/run/
H A Dcython3_no_unicode_literals.pyx54 print(*args) # this isn't valid Py2 syntax
76 …>>> print(not IS_PY2 or len(s) == 9 or len(s)) # first is 2-char bytes in Py2, hex escape is reso…
84 …>>> print(not IS_PY2 or len(s) == 9 or len(s)) # first is 2-char bytes in Py2, hex escape is reso…
98 >>> print(not IS_PY2 or len(s) == 12 or len(s)) # Py2 (first character is two bytes)
106 >>> print(not IS_PY2 or len(s) == 12 or len(s)) # Py2 (first character is two bytes)
H A Dfor_in_string.pyx26 # Py2/Py3
52 #### Py2 and Py3 behave differently here: Py2->bytes, Py3->integer
114 #### Py2 and Py3 behave differently here: Py2->bytes, Py3->integer
H A Dbytes_char_coercion.pyx45 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
78 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
110 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
146 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
/dports/lang/cython-devel/cython-2b1e743/tests/run/
H A Dcython3_no_unicode_literals.pyx54 print(*args) # this isn't valid Py2 syntax
76 …>>> print(not IS_PY2 or len(s) == 9 or len(s)) # first is 2-char bytes in Py2, hex escape is reso…
84 …>>> print(not IS_PY2 or len(s) == 9 or len(s)) # first is 2-char bytes in Py2, hex escape is reso…
98 >>> print(not IS_PY2 or len(s) == 12 or len(s)) # Py2 (first character is two bytes)
106 >>> print(not IS_PY2 or len(s) == 12 or len(s)) # Py2 (first character is two bytes)
H A Dfor_in_string.pyx26 # Py2/Py3
52 #### Py2 and Py3 behave differently here: Py2->bytes, Py3->integer
114 #### Py2 and Py3 behave differently here: Py2->bytes, Py3->integer
H A Dbytes_char_coercion.pyx45 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
78 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
110 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
146 >>> b == '\\xff' or b == '\\xff'.encode('ISO-8859-1') # Py2 or Py3
/dports/sysutils/py-salt/salt-3004.1/pkg/windows/
H A Dsign.bat75 "%Series%\Salt-%Version%-Py2-AMD64-Setup.exe" ^
76 "%Series%\Salt-%Version%-Py2-x86-Setup.exe" ^
79 "%Series%\Salt-Minion-%Version%-Py2-AMD64-Setup.exe" ^
80 "%Series%\Salt-Minion-%Version%-Py2-x86-Setup.exe" ^
122 set "file_name=Salt-%Version%-Py2-AMD64-Setup.exe"
129 set "file_name=Salt-%Version%-Py2-x86-Setup.exe"
150 set "file_name=Salt-Minion-%Version%-Py2-AMD64-Setup.exe"
157 set "file_name=Salt-Minion-%Version%-Py2-x86-Setup.exe"
/dports/x11-fonts/py-ufolint/ufolint-1.2.0/
H A DCHANGELOG.md60 - switched Py2 `basestring` type to `str` type in `ufolint.validators.typevalidators` module
61 - removed Py2 `plistlib.readPlist` in `ufolint.controllers.runner` module
62 - removed Py2 `xml.etree.CElementTree` in `ufolint.validators.plistvalidators`
63 - removed Py2 `xml.etree.CElementTree` in `ufolint.validators.xmlvalidators`

12345678910>>...15