Created
February 14, 2015 02:27
-
-
Save sayrer/f6edb2e6912df8940cb4 to your computer and use it in GitHub Desktop.
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
~ $ python | |
Python 2.7.6 (default, Mar 22 2014, 22:59:56) | |
[GCC 4.8.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> class Foo(): | |
@property | |
def bar(self): | |
return "42" | |
>>> "The magic number is {foo.bar}".format(foo=Foo()) | |
'The magic number is 42' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment