Casting classes WAS: Documenting builtin methods
dreamingforward at gmail.com
Fri Jul 12 02:23:04 CEST 2013
A user was wondering why they can't change a docstring in a module's class.
This made me think: why not have a casting operator ("reciprocal"?) to
transform a bonafide class into a mere carcass of a class which can
then modified and reanimated back into its own type with the type
function? Such that "type(reciprocal(myClass))==myClass"...
reciprocal(myClass) returns a writeable, nonproxy class.__dict__
(perhaps also a list of its bases and name)
Just a thought to consider...
More information about the Python-list