[cython/cython] [BUG] Cython dosen't support Assignment Expressions (#4066)

0 views
Skip to first unread message

haorongLemon

unread,
Mar 28, 2021, 10:18:29 PM3/28/21
to cython/cython, Subscribed

Describe the bug
according to the compiled result, Cython doesn't support alignment expression(PEP572), here is the details:

Error compiling Cython file:

------------------------------------------------------------

...

    :param match_offs:

    :param copy_cols:

    :return:

    """

    for line in range(prev_cells[0].row+1, prev_cells[1].row):                            

        if not (subj_name := ws_prev.cell(line, fin_cells[0].col_idx+match_offs).value):     # bugs here

                         ^

------------------------------------------------------------

financial.py:107:26: Expected ')', found ':'

Traceback (most recent call last):

  File "setup.py", line 22, in <module>

    ext_modules=cythonize([Extension("financial", ["financial.py"], define_macros=[("MS_WIN64", 1)])],

  File "D:\toolchain\Python38\lib\site-packages\Cython\Build\Dependencies.py", line 1102, in cythonize

    cythonize_one(*args)

  File "D:\toolchain\Python38\lib\site-packages\Cython\Build\Dependencies.py", line 1225, in cythonize_one

    raise CompileError(None, pyx_file)

Cython.Compiler.Errors.CompileError: financial.py

To Reproduce
Code to reproduce the behaviour:

# setup.py:

from distutils.core import setup, Extension

from Cython.Build import cythonize

from Cython.Distutils import build_ext



setup(name="autooffice",

      requires=["openpyxl", "cython"],

      cmdclass={'build_ext': build_ext},

      ext_modules=cythonize(

          [Extension("financial", ["financial.py"], define_macros=[("MS_WIN64", 1)])],

          compiler_directives={'language_level': 3})

      )

# exec the cmd in shell:

# $ python setup.py build --compiler=mingw32

Environment (please complete the following information):

  • OS: Windows
  • Compile: Mingw_x64
  • Python version 3.8.3 x64
  • Cython version 0.29.22


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

da-woods

unread,
Mar 29, 2021, 2:33:54 AM3/29/21
to cython/cython, Subscribed

Closed #4066.

da-woods

unread,
Mar 29, 2021, 2:33:54 AM3/29/21
to cython/cython, Subscribed

Duplicate #2636

Reply all
Reply to author
Forward
0 new messages