NoneType List

Chris Angelico rosuav at gmail.com
Sat Dec 31 22:23:13 EST 2022


On Sun, 1 Jan 2023 at 14:19, <avi.e.gross at gmail.com> wrote:
> Had a language like that been created today, I wonder if some designs might
> have looked a bit different so that some functions could be called with
> optional arguments that specified what the user wanted returned.

Frankly, I doubt it. While you can argue "returning self is more
useful" vs "returning None is more clear if you get it wrong", having
options does NOT improve things, and just makes everything more
complicated, slower, harder to comprehend, and generally worse to work
with.

A language should have some sort of consistent behaviour and stick to
it. If that's not possible, an object type should at least have that.

ChrisA


More information about the Python-list mailing list