Thanks for your answer, Jacob. I read the page in wikipedia and
actually I see some similar problems in overwriting third-party
classes (or using custom descriptors for third-party functions, or
using events, signals or hooks in programming) as in monkey-patching:
if a class changes, the custom extending class might not work as
expected.

I wrote this question in this group instead of the users'  for a
reason. I think, that this kind of question is more philosophical than
educational, and this group consists of perfectionists who are able to
answer it properly. Also I didn't want to confuse the beginners with
the possibilities of Python, so that nobody would think that
monkeypatching is a good practice (until I evaluate that to myself,
how good or bad it is).

Regards,
Aidas Bendoraitis aka Archatas

P.S. Happy upcoming winter holidays, everyone!


On Dec 20, 2:35 am, "Jacob Kaplan-Moss" <[EMAIL PROTECTED]>
wrote:
> Hi Aidas --
>
> In the future, please direct questions of this nature to django-users.
> Django-dev is for discussion of development *on* Django itself, not
> for usage questions.
>
> That said:
>
> On 12/19/07, Aidas Bendoraitis <[EMAIL PROTECTED]> wrote:
>
> > Do you consider this approach for extending existing code as a smart
> > python programming solution or an ugly hack?
>
> We usually call this "monkeypatching", and as the name implies, most
> sane developers consider it a bad idea. Wikipedia actually has a
> pretty good summary of why this is:http://en.wikipedia.org/wiki/Monkeypatch
>
> Jacob
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to