You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
300 B
14 lines
300 B
2 years ago
|
# test __dict__ attribute of a built-in module
|
||
|
# see import/module_dict.py for the equivalent test on user modules
|
||
|
|
||
|
import sys
|
||
|
|
||
|
if not hasattr(sys, "__dict__"):
|
||
|
print("SKIP")
|
||
|
raise SystemExit
|
||
|
|
||
|
|
||
|
# dict of a built-in module (read-only)
|
||
|
print(type(sys.__dict__))
|
||
|
print(sys.__dict__["__name__"])
|