|Ned Batchelder : Blog | Code | Text | Site|
Finding Python 3 builtins
» Home : Blog : February 2013
Eryksun commented on yesterday's blog post,
Sure enough, that gets you a reference to the built-ins, even in an eval with no builtins. It points up two deficiencies in my searching code from yesterday. First, I was only examining constructed objects, not the classes themselves, but more importantly, I was looking at object's attributes but not the keys in dictionaries!
Here's the updated search code, which also has some nicer uses of generators:
"""Look for builtins..."""
When I run this code, it finds things like,
and many other similar lines. The builtins were right there all along, if you know where to look.
tagged: python» react