Skip to content

Instantly share code, notes, and snippets.

@sloria
Created April 28, 2016 23:17
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
# Recorded with the doitlive recorder
#doitlive shell: /bin/bash
#doitlive prompt: sorin
```python
class Foo:
pass
# We can assign anything
f = Foo()
f.poo = '¯\_(ツ)_/¯'
f.poo
f.woo = 'o(-`д´- 。)`)'
f.woo
class EnterpriseFoo:
__slots__ = ('poo', )
# We can ONLY assign poo
ef = EnterpriseFoo()
ef.poo = '(*≧m≦*)'
ef.poo
ef.woo = '\(・`(ェ)・)/'
class EnterpriseBar(EnterpriseFoo):
pass
# We can assign anything
eb = EnterpriseBar()
eb.poo = '{{|└(>o< )┘|}}'
eb.woo = '╰༼=ಠਊಠ=༽╯'
eb.woo
class EnterpriseBaz:
__slots__ = ('poo', '__dict__')
# We can assign anything
eb = EnterpriseBaz()
eb.poo = '໒( ᓀ ‸ ᓂ )७'
eb.woo = '((╬ಠิ﹏ಠิ))'
eb.woo
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment