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

from typing import Self not supported #507

Open
akleemans opened this issue Dec 8, 2023 · 1 comment
Open

from typing import Self not supported #507

akleemans opened this issue Dec 8, 2023 · 1 comment
Assignees
Labels
stdlib Standard library feature

Comments

@akleemans
Copy link

When self-referencing inside a class, it is possible in Python to do

from typing import Self

class Node:
    neighbor: Self

Currently, referencing the Node-class directly is different in Python (neighbor: 'Node') and Codon (neighbor: Node) so I thought it would be nice to use Self, so the script could run on both Python and Codon.

Could the typing-mock be extended with Self?

@inumanag
Copy link
Contributor

Oh, we should add this—thanks for the suggestion! Right now you need to use neighbor: Node.

@inumanag inumanag self-assigned this Jan 29, 2024
@inumanag inumanag added the stdlib Standard library feature label Jan 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Standard library feature
Projects
None yet
Development

No branches or pull requests

2 participants