[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-12 Thread Stephen J. Turnbull
Kevin Mills writes: > While confusion with optional arguments is somewhat unfortunate, > the name came from an already established convention. A lot of > languages have exactly the same concept, varying between names like > Optional, Option, and Maybe. I don't think coming up with a >

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-12 Thread Kevin Mills
While confusion with optional arguments is somewhat unfortunate, the name came from an already established convention. A lot of languages have exactly the same concept, varying between names like Optional, Option, and Maybe. I don't think coming up with a Python-specific name for the same thing

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-02 Thread Stephen J. Turnbull
Jelle Zijlstra writes: > In fact, `typing.Optional` means that something can be None, *not* > that it is an optional argument. You're missing my point. Yes, the *implementation* is that the object can be None. But that's far more clearly expressed by Union[T, None] if that's what you *mean*,

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread nverich07
> BTW, I disagree with your arguments that Optional and Union are > misleading names that can be easily misunderstood, especially in the > usual context of formal arguments in function definitions. The comment made by Jelle Zijlstra suggested to me suggested that the new syntax might have been a

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread Jelle Zijlstra
El jue, 30 jun 2022 a las 22:19, Stephen J. Turnbull (< stephenjturnb...@gmail.com>) escribió: > nveric...@gmail.com writes: > > > I accidentally created another thread in python-dev as I mentioned > > above, but ideally Optional and Union should both be deprecated and > > phased out for the

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-07-01 Thread Thomas Grainger
The generic collections in typing were deprecated in favor of the generic collections in collections.abc. The objects and the types were exposed to user code, and in the future they will not be > We don't want there to be warnings about them > forever The new wanrings._deprecated

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-06-30 Thread Stephen J. Turnbull
nveric...@gmail.com writes: > I accidentally created another thread in python-dev as I mentioned > above, but ideally Optional and Union should both be deprecated and > phased out for the new syntax. I think a formal deprecation is a bad idea. An annotation is an object, which has a type.

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-06-30 Thread nverich07
I accidentally created another thread in python-dev as I mentioned above, but ideally Optional and Union should both be deprecated and phased out for the new syntax. ___ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email

[Python-ideas] Re: Confusing naming of Optional type should be changed

2022-06-30 Thread Jelle Zijlstra
El jue, 30 jun 2022 a las 10:46, escribió: > (I apologize in advance if I've posted anything incorrectly before, I > believe I might have sent this in python-dev instead but not sure as it's > not appearing in the posts for my account). > > I am aware this is clarified in the Python