weixin_39942191 2020-11-20 20:32
浏览 0

six.sys is available in Python 2.7.x but not in Python 3.3.x

Originally reported by: Daniel McDonald (Bitbucket: wasade, GitHub: wasade)

In Python 2.7:

python
$ python
Python 2.7.2 (default, Oct 11 2012, 20:14:37)
[GCC 4.2.1 Compatible Apple Clang 4.0 (tags/Apple/clang-418.0.60)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> six.__version__
'1.8.0'
>>> six.sys
<module>
>>> six.sys.maxint
9223372036854775807
</module>

In Python 3.3:

python
$ python
Python 3.3.2 (default, Sep 26 2013, 13:02:42)
[GCC 4.2.1 Compatible Apple LLVM 4.2 (clang-425.0.28)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import six
>>> six.__version__
'1.8.0'
>>> six.sys
<module>
>>> six.sys.maxint
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'maxint'
>>> from six.sys import maxint
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'six.sys'
>>> import six.sys
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'six.sys'
</module></stdin></module></stdin></module></stdin></module>
  • Bitbucket: https://bitbucket.org/gutworth/six/issue/104

该提问来源于开源项目:benjaminp/six

  • 写回答

6条回答 默认 最新

  • weixin_39942191 2020-11-20 20:32
    关注

    Original comment by Daniel McDonald (Bitbucket: wasade, GitHub: wasade):

    Ah, good point.

    I think __all__ would be nice to have as it would tidy up the namespace

    评论

报告相同问题?