Author gvanrossum
Recipients evan_, flying sheep, gvanrossum, levkivskyi
Date 2017-01-15.22:50:56
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <CAP7+vJJTO-BkZep0axmovph95FPEDay85DkqH-2mFnxSFqdU=w@mail.gmail.com>
In-reply-to <1484520531.13.0.674627680751.issue29262@psf.upfronthosting.co.za>
Content
Maybe a proposal should be discussed as an addendum to PEP 484? Or would
Mark Shannon reject that?

On Sun, Jan 15, 2017 at 2:48 PM, Ivan Levkivskyi <report@bugs.python.org>
wrote:

>
> Ivan Levkivskyi added the comment:
>
> > Maybe we need to take a step back and look at the needs for code that
> wants to implement runtime type checking more in general?
>
> I would say that the most convenient way for me would be a set of
> "inspect-style" simple helpers like ``is_union``, ``is_generic``,
> ``get_parameters`` (similar to inspect.ismethod, inspect.getargspec etc).
>
> > ISTM we have ways to access the parameters of a parameterized type
> (typically t.__parameters__) but we don't have a reasonable way yet to
> determine what kind of thing t is.
>
> There is one way that I see right now: using _gorg. For example,
> ``_gorg(Tuple[int, str]) is Tuple``, ``_gorg(Callable[..., str]) is
> Callable``, etc. This will also work for ``Union`` if we relax the assert
> that requires type to be instance of GenericMeta (now there is a common
> internal API used by almost everything in typing).
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue29262>
> _______________________________________
>
History
Date User Action Args
2017-01-15 22:50:57gvanrossumsetrecipients: + gvanrossum, flying sheep, levkivskyi, evan_
2017-01-15 22:50:57gvanrossumlinkissue29262 messages
2017-01-15 22:50:56gvanrossumcreate