Files
RustPython/tests/snippets/sysmod.py
Dong-hee Na 2e618af4f9 sys: Fix sys.maxsize and add sys.maxunicode
Current implementation of sys.maxsize is unsigned type
but AFAIK the type of sys.maxsize should be identical with
Py_ssize_t which is known as signed type.

sys.maxunicode is hardcoded from cpython repository
https://github.com/python/cpython/blob/master/Python/sysmodule.c#L2654
2019-07-10 02:48:45 +09:00

24 lines
738 B
Python

import sys
print(sys.argv)
assert sys.argv[0].endswith('.py')
assert sys.platform == "linux" or sys.platform == "darwin" or sys.platform == "win32" or sys.platform == "unknown"
assert isinstance(sys.builtin_module_names, tuple)
assert 'sys' in sys.builtin_module_names
assert isinstance(sys.implementation.name, str)
assert isinstance(sys.implementation.cache_tag, str)
assert sys.getfilesystemencoding() == 'utf-8'
assert sys.getfilesystemencodeerrors().startswith('surrogate')
assert sys.byteorder == "little" or sys.byteorder == "big"
assert isinstance(sys.flags, tuple)
assert type(sys.flags).__name__ == "flags"
assert type(sys.flags.optimize) is int
assert sys.flags[3] == sys.flags.optimize
assert sys.maxunicode == 1114111