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

Class introspective

Lib/test/datetimetester.py:4379–4383  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4377 cls = self.theclass
4378 # A datetime passes itself on, a time passes None.
4379 class introspective(tzinfo):
4380 def tzname(self, dt): return dt and "real" or "none"
4381 def utcoffset(self, dt):
4382 return timedelta(minutes = dt and 42 or -42)
4383 dst = utcoffset
4384
4385 obj = cls(1, 2, 3, tzinfo=introspective())
4386

Callers 1

test_argument_passingMethod · 0.85

Calls

no outgoing calls

Tested by 1

test_argument_passingMethod · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…