Created
March 12, 2014 14:34
-
-
Save jaytaph/9508160 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 2.7.3 (default, Jan 2 2013, 16:53:07) | |
[GCC 4.7.2] on linux2 | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> s = "foo" | |
>>> type(s) | |
<type 'str'> | |
>>> class mys(str) : | |
... i = 4; | |
... | |
>>> type(s) | |
<type 'str'> | |
>>> s1 = mys("o hai") | |
>>> type(s1) | |
<class '__main__.mys'> | |
>>> s2 = s1.upper() | |
>>> s2 | |
'O HAI' | |
>>> type(s2) | |
<type 'str'> | |
>>> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment