Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support syntax for variable annotation in Python 3.6 #575

Closed
east825 opened this issue Sep 23, 2016 · 1 comment · Fixed by #612
Closed

Support syntax for variable annotation in Python 3.6 #575

east825 opened this issue Sep 23, 2016 · 1 comment · Fixed by #612

Comments

@east825
Copy link

east825 commented Sep 23, 2016

PEP 526 introduced the syntax for variable annotations in Python 3.6. At the moment pycodestyle.py warns of every such annotation taking them for "E701 multiple statements on one line (colon)":

from typing import ClassVar, List

CONST: int = 42  # E701


class Class:
    cls_var: ClassVar[str]  # E701

    def m(self):
        xs: List[int] = []  # E701
$ python3.6 pycodestyle.py variable_annotations.py 
variable_annotations.py:3:6: E701 multiple statements on one line (colon)
variable_annotations.py:7:12: E701 multiple statements on one line (colon)
variable_annotations.py:10:11: E701 multiple statements on one line (colon)
@hassanselim0
Copy link

hassanselim0 commented Dec 25, 2018

The following doesn't work as expected:

class Person:
    name: str

Pycodestyle returns 'name' used before definition

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants