The Python Oracle

How to add property to a class dynamically?

Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn

--

Music by Eric Matyas
https://www.soundimage.org
Track title: Droplet of life

--

Chapters
00:00 Question
01:07 Accepted answer (Score 437)
03:44 Answer 2 (Score 67)
04:08 Answer 3 (Score 46)
04:53 Answer 4 (Score 40)
05:20 Thank you

--

Full question
https://stackoverflow.com/questions/1325...

Question links:
[How is the __getattribute__ method used?]: https://stackoverflow.com/questions/3717...

Accepted answer links:
[descriptor]: http://docs.python.org/2/reference/datam...
[wordy blog post about descriptors]: http://me.veekun.com/blog/2012/05/23/pyt.../

Answer 4 links:
[namedtuple]: http://docs.python.org/library/collectio...

--

Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...

--

Tags
#python #properties #runtime #monkeypatching

#avk47