> > 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.
PEP 3119 does say that ABC's are "not the end of ducktyping": https://www.python.org/dev/peps/pep-3119/#abcs-vs-duck-typing . As I understand it, objects/programs can't be "wrong" with respect to the PEP, they might just find using ABC's useful. > 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? You wrote two other comments in your initial message on the ticket about suggestions for template rendering, re: SimpleNamespace and ChainMap. On 10 November 2017 at 17:15, <[email protected]> wrote: > 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. > -- Adam -- 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/CAMyDDM1y_BRACFY-BiqgTi0dSJ%3DO6z8uU90xaZ1if7LUHQ0H1w%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
