MCPcopy Index your code
hub / github.com/RustPython/RustPython / __getattr__

Function __getattr__

Lib/calendar.py:46–56  ·  view source on GitHub ↗
(name)

Source from the content-addressed store, hash-verified

44
45
46def __getattr__(name):
47 if name in ('January', 'February'):
48 import warnings
49 warnings.warn(f"The '{name}' attribute is deprecated, use '{name.upper()}' instead",
50 DeprecationWarning, stacklevel=2)
51 if name == 'January':
52 return 1
53 else:
54 return 2
55
56 raise AttributeError(f"module '{__name__}' has no attribute '{name}'")
57
58
59# Constants for months

Callers

nothing calls this directly

Calls 2

warnMethod · 0.45
upperMethod · 0.45

Tested by

no test coverage detected