Create only one instance of each distinct tuple
(*args)
| 43 | |
| 44 | |
| 45 | def 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 |
no test coverage detected