summaryrefslogtreecommitdiffstats
path: root/Python/Dependencies/future-0.18.2/docs/limitations.rst
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2022-12-17 17:26:16 -0800
committeryum <yum.food.vr@gmail.com>2022-12-17 17:26:16 -0800
commit4d836989720523cd0363927e3e066f56b9dc445c (patch)
treef7a9ff7cb50eda1ff29e91c78067dcc5e0ce6233 /Python/Dependencies/future-0.18.2/docs/limitations.rst
parentda754e9cf5b192239826aa1619e1ada3c98daa45 (diff)
Check in `future` package
I hit some issues installing Whisper and had to embed this package. I haven't taken the time to deeply understand what's going on. I think that embedded Python follows different rules about resolving module paths than regular system Python. Basically, `future`'s setup.py has a line like `import src`, where `src` is a module inside future (like `future/src/__init__.py`). This doesn't work unless we put that directory on the search path.
Diffstat (limited to 'Python/Dependencies/future-0.18.2/docs/limitations.rst')
-rw-r--r--Python/Dependencies/future-0.18.2/docs/limitations.rst52
1 files changed, 52 insertions, 0 deletions
diff --git a/Python/Dependencies/future-0.18.2/docs/limitations.rst b/Python/Dependencies/future-0.18.2/docs/limitations.rst
new file mode 100644
index 0000000..0d13805
--- /dev/null
+++ b/Python/Dependencies/future-0.18.2/docs/limitations.rst
@@ -0,0 +1,52 @@
+limitations of the ``future`` module and differences between Py2 and Py3 that are not (yet) handled
+===================================================================================================
+
+The following attributes on functions in Python 3 are not provided in Python
+2.7:
+
+__func__: see six.get_method_function()
+__self__: see six.get_method_self()
+__self__.__class__
+
+
+Limitations of the ``futurize`` script
+--------------------------------------
+The ``futurize`` script is not yet mature; like ``2to3``, on which it is based,
+it makes mistakes. Nevertheless, it should be useful for automatically
+performing a lot of the repetitive code-substitution tasks when porting from
+Py2 to Py2/3.
+
+Some new Python 3.3 features that cause SyntaxErrors on earlier versions
+are not currently handled by the ``futurize`` script. This includes:
+
+- ``yield ... from`` syntax for generators in Py3.3
+
+- ``raise ... from`` syntax for exceptions. (This is simple to fix
+ manually by creating a temporary variable.)
+
+Also:
+
+- Usage of ``file('myfile', 'w')`` as a synonym for ``open`` doesn't seem
+ to be converted currently.
+
+- ``isinstance(var, basestring)`` should sometimes be converted to
+ ``isinstance(var, str) or isinstance(var, bytes)``, or sometimes simply
+ ``isinstance(var, str)``, depending on the context. Currently it is always
+ converted to ``isinstance(var, str)``.
+
+- Caveats with bytes indexing!::
+
+ b'\x00'[0] != 0
+ b'\x01'[0] != 1
+
+ ``futurize`` does not yet wrap all byte-string literals in a ``bytes()``
+ call. This is on the to-do list. See :ref:`bytes-object` for more information.
+
+
+Notes
+-----
+- Ensure you are using new-style classes on Py2. Py3 doesn't require
+ inheritance from ``object`` for this, but Py2 does. ``pasteurize``
+ adds this back in automatically, but ensure you do this too
+ when writing your classes, otherwise weird breakage when e.g. calling
+ ``super()`` may occur.