Compatibility with variable annotations (PEP 526)
See original GitHub issueHi,
when trying to compile the following code:
n: int = 10
which uses PEP 526 style variable annotation (introduced in Python 3.6.0 beta 1) we get the following result from cython 0.26.1:
Error compiling Cython file:
------------------------------------------------------------
...
n: int = 10
^
------------------------------------------------------------
test.pyx:1:1: Syntax error in simple statement list
Is this a known limitation of cython that will be resolved in near future? Our code base uses a lot of variable annotations (helps documenting the code and refactoring) and this issue prevents us from using cython without code changes.
Issue Analytics
- State:
- Created 6 years ago
- Comments:9 (4 by maintainers)
Top Results From Across the Web
PEP 526 – Syntax for Variable Annotations
Type annotations should not be confused with variable declarations in statically typed languages. The goal of annotation syntax is to provide an easy...
Read more >Support Python 3.6 PEP 526 Syntax for Variable Annotations
It seems that the PEP 526 will be implemented in Python 3.6: any variable name and assignment can be annotated with typing hints...
Read more >Add support for Variable Annotations (PEP 526) (#2706) · Issues ...
Created originally on Bitbucket by Kentzo Python 3.6 allows to annotate variables. PyPy should support new syntax for code compatibility.
Read more >Try to understand "Class and instance variable annotations" in ...
It seems to me that I misunderstand the PEP 526 in the context of annotating class and instance variables. Based on the example...
Read more >[Python-Dev] Please reject or postpone PEP 526
it states that "Variable annotations have already been around for almost two years in the form of type comments, sanctioned by PEP 484."...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for my late reply. Works like a charm! Thanks a lot.
Implemented in latest master. Could you please give it a try?