On Tue, Mar 5, 2019 at 12:53 AM Jonathan Fine <jfine2...@gmail.com> wrote:

> SUMMARY
> Instead of using dict + dict, perhaps use dict.flow_update. Here,
> flow_update is just like update, except that it returns self.


That violates an important convention in Python: mutating methods do not
return self. We really want to preserve that convention.

On the other hand, as seen in other recent threads, there is a desire for
chaining operations of many sorts, so a .flow_update() that returned a new
dict would provide that feature.

Though I would only recommend that if it was decided that we wanted to
generally support that approach for all mutable containers — which would
mean adding quite a few methods.

And we could then use the same naming convention for them all.

I’m not sure I like “flow_” though, it’s not very commonly known jargon.

-CHB

-- 
Christopher Barker, PhD

Python Language Consulting
  - Teaching
  - Scientific Software Development
  - Desktop GUI and Web Development
  - wxPython, numpy, scipy, Cython
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to