MCPcopy Index your code
hub / github.com/python/cpython / __getattr__

Function __getattr__

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

warnMethod · 0.45
upperMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…