Created
February 10, 2015 15:02
-
-
Save christianp/0a4706c800084bd384a4 to your computer and use it in GitHub Desktop.
Python gives up finding the attribute before evaluating arguments
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = {} | |
def b(): | |
print("b") | |
a.q(b()) # gives an AttributeError, doesn't call b | |
a['q'](b()) # gives a KeyError, doesn't call b |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment