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

[BUG] Support for Generic classes #6515

Open
camin616 opened this issue Nov 24, 2024 · 1 comment
Open

[BUG] Support for Generic classes #6515

camin616 opened this issue Nov 24, 2024 · 1 comment

Comments

@camin616
Copy link

camin616 commented Nov 24, 2024

Describe the bug

Hello, I am trying to use Cython to compile my Python code, which involves Generic classes (https://docs.python.org/3.12/reference/compound_stmts.html#generic-classes). I encountered the following error during the conversion:

Error compiling Cython file:

------------------------------------------------------------
...

if TYPE_CHECKING:
    from game.mobject import Game


class Container[Card: CardBase]:
               ^
------------------------------------------------------------

scripts/arena/container/mobject.py:13:15: Expected ':', found '['
```bash

### Code to reproduce the behaviour:

```python
class Container[Card: CardBase]:
    pass

Expected behaviour

No response

OS

archlinux

Python version

3.12.7

Cython version

3.0.11

Additional context

No response

@Spill-Tea
Copy link

this is a syntax error.

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

No branches or pull requests

2 participants