[Python-ideas] Trial balloon: adding variable type declarations in support of PEP 484

Paul Moore p.f.moore at gmail.com
Wed Aug 3 11:47:12 EDT 2016


On 3 August 2016 at 16:40, Alexander Belopolsky
<alexander.belopolsky at gmail.com> wrote:
> On Wed, Aug 3, 2016 at 11:31 AM, Joao S. O. Bueno <jsbueno at python.org.br> wrote:
>> An __annotations__ dict straight in the class itself? I think that is
>> the obvious thing - although I did not see it in the above messages.
>> (A s I said, I may have missed its mention)
>
> It was mentioned that var annotations would be evaluated and
> discarded, but I agree that this is less than ideal.  I agree that it
> is better to store var annotations in the namespace that they appear
> in.

Agreed, it seems a shame that this would be an area where it's not
possible to introspect data that was available at compile time. (I'd
say it doesn't feel Pythonic, except that claiming that Guido's
proposing something non-Pythonic is self-contradictory :-))

However, I have no expectation of ever needing this data for anything
I'd write, so it's not actually something that would matter to me one
way or the other.
Paul


More information about the Python-ideas mailing list