On Mon, Apr 20, 2020 at 10:07 AM gyro funch <gyromagne...@gmail.com> wrote:

> On 4/20/2020 9:25 AM, J. Pic wrote:
> The following is not currently possible, but is consistent with other
> functions such as 'sorted':
>
> something = mylist.appended(Something())
>

no, it's not -- sorted() is a function, not a method. and there is a reason
it's not list.sorted() (more than one actually)

It turns out the OP wan't asking for exactly what I thought, but the point
still stands: mutating methods return None. That is a consistent interface
standard in Python.

But your suggestion of an .appended()  method does tie in to the "fluid
interface" conversation on this list a while back -- if you are interested
in the idea, I suggest you search the archives.

-CHB





> -gyro
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/JH3F46JTLCH3ZIYCOVS4ULAYW3CJNUP4/
> Code of Conduct: http://python.org/psf/codeofconduct/
>


-- 
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
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/FEWJKDU2DC2WKSEIQYDDMAQBNLQPYDDY/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to