Partial classes

Sanjay skpatel20 at hotmail.com
Thu Jul 20 01:23:15 EDT 2006


> Anyway, I would suggest you NOT to use this code in production. Yes,
> Python
> can imitate Ruby, but using this kind of classes would confuse
> everybody and
> make your code extremely unpythonic. As always, consider changing your
> mindset,
> when you switch language. For you problem, you could just put your
> client
> methods in a file, and add them to your original class with setattr, if
> you don't
> want to use inheritance. It would be still better that magically
> transform your
> classes with a metaclass.

Thanks for the much needed guidence.

Sanjay




More information about the Python-list mailing list