我在哪里可以找到 Python-未完全实现的未来导入的文档?
Where can I find documentation of Python-Future imports that are incompletely implemented?
我最近发现 future
中可用的 round
函数不支持负数舍入,这与内置 round
:
不兼容
>>> from builtins import round
>>> round(4781, -2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/future/builtins/newround.py", line 33, in newround
raise NotImplementedError('negative ndigits not supported yet')
NotImplementedError: negative ndigits not supported yet
这在一定程度上限制了 Python-Future 快速入门建议的用途:
The easiest way is to start each new module with these lines:
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from builtins import *
Then write standard Python 3 code.
我在任何地方都找不到 round
不兼容的记录,想知道还有哪些其他函数或类型的行为不同或具有未实现的功能。还有哪些陷阱?这些不兼容性记录在哪里?
没有这样的列表。
Python-Future 项目完全独立于Python 项目,因此您确实不会在官方列出的Python-Future 项目中发现任何实施差距Python 文档。
不幸的是reference documentation for round()
fails to mention this gap in the implementation. An oblique reference to the newround
module docstring isn't helpful either, as it too is very scant on details。
你得向Python-未来的项目询问这样的列表,你可以尝试file an issue让他们制作这样的列表。
在此期间,您可以在源代码中search for NotImplementedError
references。这将产生一个不完整的列表,因为在实现中可能存在一些缺陷,而这些缺陷并没有被引发该异常所涵盖。
就个人而言,我建议不要使用 Python-Future;该项目在不考虑适用性或性能的情况下向后移植所有内容的理念不适合生产代码;例如,他们的 super()
implementation 必须依靠对 class MRO 上所有属性的全面扫描来定位相关的 class 以用作第一个参数,这使得它变得缓慢而繁琐。仅仅因为您可以以某种方式使它工作并不意味着您应该这样做。
他们的实施不完整,没有明确指出差距在哪里,这只会让我更难改变对项目的看法。
我最近发现 future
中可用的 round
函数不支持负数舍入,这与内置 round
:
>>> from builtins import round
>>> round(4781, -2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/future/builtins/newround.py", line 33, in newround
raise NotImplementedError('negative ndigits not supported yet')
NotImplementedError: negative ndigits not supported yet
这在一定程度上限制了 Python-Future 快速入门建议的用途:
The easiest way is to start each new module with these lines:
from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import *
Then write standard Python 3 code.
我在任何地方都找不到 round
不兼容的记录,想知道还有哪些其他函数或类型的行为不同或具有未实现的功能。还有哪些陷阱?这些不兼容性记录在哪里?
没有这样的列表。
Python-Future 项目完全独立于Python 项目,因此您确实不会在官方列出的Python-Future 项目中发现任何实施差距Python 文档。
不幸的是reference documentation for round()
fails to mention this gap in the implementation. An oblique reference to the newround
module docstring isn't helpful either, as it too is very scant on details。
你得向Python-未来的项目询问这样的列表,你可以尝试file an issue让他们制作这样的列表。
在此期间,您可以在源代码中search for NotImplementedError
references。这将产生一个不完整的列表,因为在实现中可能存在一些缺陷,而这些缺陷并没有被引发该异常所涵盖。
就个人而言,我建议不要使用 Python-Future;该项目在不考虑适用性或性能的情况下向后移植所有内容的理念不适合生产代码;例如,他们的 super()
implementation 必须依靠对 class MRO 上所有属性的全面扫描来定位相关的 class 以用作第一个参数,这使得它变得缓慢而繁琐。仅仅因为您可以以某种方式使它工作并不意味着您应该这样做。
他们的实施不完整,没有明确指出差距在哪里,这只会让我更难改变对项目的看法。