On Tue, Jul 9, 2019 at 4:15 PM Andrew Barnert via Python-ideas <
python-ideas@python.org> wrote:
> On Jul 9, 2019, at 13:09, Shay Cohen wrote:
> >
> > >>> a: 3
>
> The reason this isn’t a syntax error is that Python allows any valid
> expression as an annotation. And “3” is just as valid an
On Jul 9, 2019, at 13:09, Shay Cohen wrote:
>
> >>> a: 3
The reason this isn’t a syntax error is that Python allows any valid expression
as an annotation. And “3” is just as valid an expression as “int”.
More generally, annotations don’t actually do anything at runtime, except get
stored in
On Wed, Jul 10, 2019 at 6:11 AM Shay Cohen wrote:
>
>
> >>> a: 3
> >>> type(a: 3)
> File "", line 1
> type(a: 3)
> ^
> SyntaxError: invalid syntax
> >>> a: 3
> >>> type(a)
> Traceback (most recent call last):
> File "", line 1, in
> NameError: name 'a' is not defined
> >>> a
>