By magic I meant magic methods; rather than creating a class and defining __str__() or __unicode__() on it, why not just use a unicode subclass?
And the micro-DSL is 100% optional. All of the operator overrides are aliases to other methods, with the exception of __and__() and __or__ (), which are tiny wrappers over add_query_param() and set_query_param () respectively. -- Zack On 13 Sep 2009, at 18:59, Ivan Sagalaev wrote: > > Zachary Voase wrote: >> If you take a look, you’ll notice that URLObject, being a subclass of >> unicode, can be used *directly* within the template and it'll render >> out to the URL without any magic. > > Beware! Using the word "magic" too loosely may infuriate certain core > devs and they will start hunting you all over the globe, or worse, > strike you out of a Christmas present list for this year! > > Honestly, having an object that looks like unicode but at the same > time > able to be /-ed or |-ed with another unicode in my dictionary *is* > called "magic". > > I still fail to see why this clever micro-DSL is needed when all this > can be done with normal Python and be more clear. > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to django-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---