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

Python 3.7: from __future__ import annotations #2950

matkuki opened this issue May 8, 2019 · 1 comment


None yet
2 participants
Copy link

commented May 8, 2019


I'm on Windows 10, Python 3.7.1, Cython 0.29.7.

I have some pure python code that I wanted to compile that uses
from __future__ import annotations, but compiling it throws:

Error compiling Cython file:
# -*- coding: utf-8 -*-

from __future__ import annotations
------------------------------------------------------------ future feature annotations is not defined
Traceback (most recent call last):
  File "D:\app\", line 59, in <module>
  File "D:\app\", line 54, in main
  File "C:\Python37\lib\site-packages\Cython\Build\", line 1097, in cythonize
  File "C:\Python37\lib\site-packages\Cython\Build\", line 1220, in cythonize_one
    raise CompileError(None, pyx_file)
Cython.Compiler.Errors.CompileError: app/

It is used to type annotate some self method parameters that need to reference itself.
I'm guessing that this is a not yet supported feature of CPython 3.7? Is there a way to bypass this without removing the from __future__ import annotations code?


@matkuki matkuki changed the title PYthon 3.7: from __future__ import annotations Python 3.7: from __future__ import annotations May 8, 2019


This comment has been minimized.

Copy link

commented May 19, 2019

Duplicate of #2863.

@scoder scoder closed this May 19, 2019

@scoder scoder added the R: duplicate label May 19, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.