Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.11/site-packages/past/types/__init__.py: 56%

Shortcuts on this page

r m x   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

16 statements  

1""" 

2Forward-ports of types from Python 2 for use with Python 3: 

3 

4- ``basestring``: equivalent to ``(str, bytes)`` in ``isinstance`` checks 

5- ``dict``: with list-producing .keys() etc. methods 

6- ``str``: bytes-like, but iterating over them doesn't product integers 

7- ``long``: alias of Py3 int with ``L`` suffix in the ``repr`` 

8- ``unicode``: alias of Py3 str with ``u`` prefix in the ``repr`` 

9 

10""" 

11 

12from past import utils 

13 

14if utils.PY2: 

15 import __builtin__ 

16 basestring = __builtin__.basestring 

17 dict = __builtin__.dict 

18 str = __builtin__.str 

19 long = __builtin__.long 

20 unicode = __builtin__.unicode 

21 __all__ = [] 

22else: 

23 from .basestring import basestring 

24 from .olddict import olddict 

25 from .oldstr import oldstr 

26 long = int 

27 unicode = str 

28 # from .unicode import unicode 

29 __all__ = ['basestring', 'olddict', 'oldstr', 'long', 'unicode']