Skip to content

Add support for pep-0484 function annotation syntax #257

Open

Description

@mcarans

Python Future function annotations are different to how it is suggested to be done in pep-0484. It would be great to add support for the pep-0484 syntax - this works in PyCharm for example.

I've raised an issue on Python Future syntax in PyCharm here: https://youtrack.jetbrains.com/issue/PY-22019 - it would be great to get consistency between the tools/libraries on this.

Also, another standard to keep an eye on for support concerns variable annotations.

Activity

  1. mcarans commented on Dec 29, 2016

    @mcarans
    Author

    PyCharm Developer Mikhail Golubev 27 Dec 2016, 15:35
    "Type comments are the version-independent approach to type annotations, applicable both in Python 2 and Python 3. Also, in future we might add a refactoring to automatically convert type hints from one format to another. BTW, I've never seen that idea about the direct use of annotations attribute before. I doubt that existing type checkers support it."

    It seems that the annotations approach for type in Py2.7 is not likely to be supported by any type checkers, so the best solution is to add support for PEP0484 type comments to Python Future (and pasteurize).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions