MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / memorized_ttinfo

Function memorized_ttinfo

tests/test_code/py/pytz/tzinfo.py:45–56  ·  view source on GitHub ↗

Create only one instance of each distinct tuple

(*args)

Source from the content-addressed store, hash-verified

43
44
45def memorized_ttinfo(*args):
46 '''Create only one instance of each distinct tuple'''
47 try:
48 return _ttinfo_cache[args]
49 except KeyError:
50 ttinfo = (
51 memorized_timedelta(args[0]),
52 memorized_timedelta(args[1]),
53 args[2]
54 )
55 _ttinfo_cache[args] = ttinfo
56 return ttinfo
57
58_notime = memorized_timedelta(0)
59

Callers 1

build_tzinfoFunction · 0.90

Calls 1

memorized_timedeltaFunction · 0.85

Tested by

no test coverage detected