Add a builtin and save the original.
(self, key, value)
| 51 | return False |
| 52 | |
| 53 | def add_builtin(self, key, value): |
| 54 | """Add a builtin and save the original.""" |
| 55 | bdict = builtin_mod.__dict__ |
| 56 | orig = bdict.get(key, BuiltinUndefined) |
| 57 | if value is HideBuiltin: |
| 58 | if orig is not BuiltinUndefined: #same as 'key in bdict' |
| 59 | self._orig_builtins[key] = orig |
| 60 | del bdict[key] |
| 61 | else: |
| 62 | self._orig_builtins[key] = orig |
| 63 | bdict[key] = value |
| 64 | |
| 65 | def remove_builtin(self, key, orig): |
| 66 | """Remove an added builtin and re-set the original.""" |
nothing calls this directly
no outgoing calls
no test coverage detected