Nov-07-2018, 04:03 AM
you say "user defined types" and that is the big catch, and the limitation of python that prevents full utilization of dynamic types. in summary not all types can be fully used dynamically; only "user defined types" can. this is the limitation that prevents making a function (named whatever you want to name it) do as i described (or any similar generic facility like this) with any type, dynamically. and the saddest part is that this would not be hard to add, conceptually (although i have no idea what limitations a specific implementation might impose). just the ability to (retroactively) add methods to a builtin (any existing) class is enough to achieve it.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.