vc2_conformance.py2x_compat
: Python 3.x backports¶
The vc2_conformance.py2x_compat
module provides backported
implementations of various functions from Python 3 which are used by this
software.
-
zip_longest
()¶ In Python 3.x an alias for
itertools.zip_longest()
, in Python 2.x, an alias foritertools.izip_longest
.
-
get_terminal_size
()¶ In Python 3.x an alias for
shutil.get_terminal_size()
, in Python 2.x, a dummy function always returning(80, 20)
.
-
wraps
()¶ In Python 3.x an alias for
functools.wraps()
. In Python 2.x, an alternative implementation offunctools.wraps
which includes the Python 3.x behaviour of setting the__wrapped__
attribute to allow introspection of wrapped functions (seeunwrap()
).
-
unwrap
()¶ In Python 3.x an alias for
inspect.unwrap()
. In Python 2.x a backported implementation of that function. Relies on the backportedwraps()
implementation provided by this module.
-
quote
()¶ In Python 3.x an alias for
shlex.quote()
, in Python 2.x, an alias forpipes.quote
.
-
string_types
¶ A tuple enumerating the native string-like types. In Python 3.x,
(str, )
, in Python 2.x,(str, unicode)
.
-
gcd
()¶ In Python 3.x an alias for
math.gcd()
, in Python 2.x, an alias forfractions.gcd
.
-
makedirs
()¶ In Python 3.x an alias for
os.makedirs()
. In Python 2.x, a backport of this function which includes theexist_ok
argument.
-
FileType
()¶ In Python 3.x an alias for
argparse.FileType
. In Python 2.x, a wrapper aroundargparse.FileType
adding support for the ‘encoding’ keyword argument when opening with mode “r”.