PyDocs

Nav

Python Runtime Services

flags

sys

data · Added in 3.2.3
The named tuple flags exposes the status of command line flags. Flags should only be accessed only by name and not by index. The attributes are read only.
Changed in 3.2, 3.3, 3.4, 3.7, 3.10, 3.11, 3.13, 3.14, 3.15
  • 3.2: Added quiet attribute for the new -q flag.
  • 3.3: Removed obsolete division_warning attribute.
  • 3.4: Added isolated attribute for -I isolated flag.
  • 3.7: Added the dev_mode attribute for the new Python Development Mode and the utf8_mode attribute for the new -X utf8 flag.
  • 3.10: Added warn_default_encoding attribute for -X warn_default_encoding flag.
  • 3.11: Added the safe_path attribute for -P option.
  • 3.11: Added the int_max_str_digits attribute.
  • 3.13: Added the gil attribute.
  • 3.14: Added the thread_inherit_context attribute.
  • 3.14: Added the context_aware_warnings attribute.
  • 3.15: Added the lazy_imports attribute.
Members of flags

c

context_aware_warnings
-X context_aware_warnings

g

gil
-X gil

l

lazy_imports
-X lazy_imports

o

optimize
-O or -OO

t

thread_inherit_context
-X thread_inherit_context

u

utf8_mode
-X utf8

w

warn_default_encoding
-X warn_default_encoding
0 Examples
No examples for sys/flags.
See Also
No see-alsos for sys/flags
0 Notes
No notes for flags