Fredrik Lundh wrote: > Reinhold Birkenfeld wrote: > >> What is wrong with something like this: >> >> >>> class Quitter: >> ... def __repr__(self): raise SystemExit >> ... >> >>> exit = quit = Quitter() > >>>> vars() # oops! You're right. >>> class Quitter: ... def __repr__(self): ... n = sys._getframe(1).f_code.co_names ... if n == ("exit",) or n == ("quit",): ... raise SystemExit better? ;) Reinhold -- Mail address is perfectly valid!
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4