1 2cimport cython 3import sys 4 5IS_PY3 = sys.version_info[0] >= 3 6 7def _bool(): 8 """ 9 >>> _bool() == bool() 10 True 11 """ 12 return bool() 13 14def _int(): 15 """ 16 >>> _int() == int() 17 True 18 """ 19 return int() 20 21def _long(): 22 """ 23 >>> IS_PY3 or _long() == long() 24 True 25 """ 26 return long() 27 28def _float(): 29 """ 30 >>> _float() == float() 31 True 32 """ 33 return float() 34 35def _complex(): 36 """ 37 >>> _complex() == complex() 38 True 39 """ 40 return complex() 41 42def _bytes(): 43 """ 44 >>> IS_PY3 and _bytes() == bytes() or _bytes() == str() 45 True 46 """ 47 return bytes() 48 49def _str(): 50 """ 51 >>> _str() == str() 52 True 53 """ 54 return str() 55 56def _unicode(): 57 """ 58 >>> IS_PY3 and _unicode() == str() or _unicode() == unicode() 59 True 60 """ 61 return unicode() 62 63def _tuple(): 64 """ 65 >>> _tuple() == tuple() 66 True 67 """ 68 return tuple() 69 70def _list(): 71 """ 72 >>> _list() == list() 73 True 74 """ 75 return list() 76 77def _dict(): 78 """ 79 >>> _dict() == dict() 80 True 81 """ 82 return dict() 83 84py_set = cython.set 85 86def _set(): 87 """ 88 >>> _set() == py_set() 89 True 90 """ 91 return set() 92 93py_frozenset = cython.frozenset 94 95def _frozenset(): 96 """ 97 >>> _frozenset() == py_frozenset() 98 True 99 """ 100 return frozenset() 101