Andrew Barnert wrote:
> On Aug 29, 2019, at 16:03, Dominik Vilsmeier [email protected] wrote:
> > I never really understood the importance of
> > Optional. Often it can be left out altogether and in other cases I find
> > Union[T, None] more expressive (explicit) than Optional[T] (+
> > the
Why not extend isInstance to :
isinstance(object:Any,classinfo: Iterable | Union) ?
Le ven. 30 août 2019 à 09:41, Dominik Vilsmeier
a écrit :
> Andrew Barnert wrote:
> > On Aug 29, 2019, at 16:03, Dominik Vilsmeier [email protected]
> wrote:
> > > I never really understood the importanc
On Aug 30, 2019, at 02:09, Philippe Prados wrote:
>
> Why not extend isInstance to :
>
> isinstance(object:Any,classinfo: Iterable | Union) ?
How would you pass a single type?
And once you allow a single type, you shouldn’t have to do anything special to
allow a Union, because a Union is alre
May be, with
isinstance(object:Any,classinfo: Tuple | Union) ?
it's possible to accept
isinstance(anUnion, [Union]) # Force tuple for Union
isinstance(aTuple, [Tuple] # Force Tuple
isinstance(aStr, int | str)
Correct ?
Le ven. 30 août 2019 à 19:29, Andrew Barnert a écrit :
> On Aug 30, 2019
On Aug 30, 2019, at 11:26, Philippe Prados wrote:
>
> May be, with
>> isinstance(object:Any,classinfo: Tuple | Union) ?
>
> it's possible to accept
>
> isinstance(anUnion, [Union]) # Force tuple for Union
> isinstance(aTuple, [Tuple] # Force Tuple
> isinstance(aStr, int | str)
>
> Correct ?
> I can’t think of any uses other than Optional.
Also, in IPython and Jupyter Lab `?smth` displays help for symbol `smth`.
___
Python-ideas mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail
On Aug 30, 2019, at 18:40, Pasha Stetsenko wrote:
>> I can’t think of any uses other than Optional.
>
> Also, in IPython and Jupyter Lab `?smth` displays help for symbol `smth`.
Yeah, and probably more Python users regularly use IPython than, say, BASIC, so
maybe a bit more potential for confu