ciao Adam,

>> there are classes in the Pythoniverse that implement a __getitem__
>> method for the sake of syntactical sweetness, but they are no
>> mappings.
> 
> My understanding of what ducktyping means is that by implementing
> __getitem__ such objects are declaring they are mappings.

nope, that would mean that sequences are to be considered mappings as 
well. please see the (more or less enlightning) rationale by Guido in 
the mentioned PEP. it describes a paradigm that is essential in the
dawning Age of Typing in Python. which is a good one in terms of code
quality.

> I'm -1 on this change because the scope is very large (potentially
> breaking millions of lines of templates in the real world) and it's
> also a fairly subtle difference, which makes it hard to explain to end
> users.

as i said, the implementation strictly follows what is described in the
documentation. so it may only be to be explained that the implementation
of an object that they are using is wrong in regards to the mentioned
PEP 3119.
furthermore there's still a fallback with a deprecation warning in
place.

> Some of your other suggestions for speeding up template rendering
> would be worth looking into though, any speed gains would be welcome.

afaik, i have done nothing to increase speed. just readability and
congruence with the state of Python. can you point out what you mean 
specifically?

> As to solving your initial problem, Tim's suggestion on the ticket of
> wrapping such objects with a class that implements the correct lookup
> behaviour in templates, is a sensible approach.

yet, my understanding is still that my problem is caused by a bug in 
Django.

best regards, Frank

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a05c31889c61d55295dc3ba5eacf064d%40riseup.net.
For more options, visit https://groups.google.com/d/optout.

Reply via email to