Skip to content

Instantly share code, notes, and snippets.

@jaytaph
Created March 12, 2014 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaytaph/9508160 to your computer and use it in GitHub Desktop.
Save jaytaph/9508160 to your computer and use it in GitHub Desktop.
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