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 APIview] ivar annotations per PEP526 showing up as cvars #5197

Closed
kristapratico opened this issue Jan 24, 2023 · 0 comments · Fixed by #5653
Closed

[Python APIview] ivar annotations per PEP526 showing up as cvars #5197

kristapratico opened this issue Jan 24, 2023 · 0 comments · Fixed by #5653

Comments

@kristapratico
Copy link
Member

Context: https://apiview.dev/Assemblies/Review/f654d0b58676400a9fe225b5df013d73?diffRevisionId=c550c432e8eb485eac666b722bfcdcd4&diffOnly=True&revisionId=c5256ddacaff4b25b6f6eae95676fca5&doc=False#24bfe5a892a5434bb01aeb2d039909bd

PEP526: https://peps.python.org/pep-0526/#class-and-instance-variable-annotations

class BasicStarship:
    captain: str = 'Picard'                  # instance variable with default
    damage: int                                 # instance variable without default
    stats: ClassVar[Dict[str, int]] = {}  # class variable

captain and damage should be ivar in APIView, while stats should be cvar since it is explicitly marked.

tjprescott added a commit that referenced this issue Mar 7, 2023
tjprescott added a commit that referenced this issue Mar 7, 2023
tjprescott added a commit that referenced this issue Mar 7, 2023
@github-project-automation github-project-automation bot moved this to 🆕 New in ApiView Mar 8, 2023
@maririos maririos moved this from 🆕 New to 📋 Backlog in ApiView Mar 8, 2023
@github-project-automation github-project-automation bot moved this from 📋 Backlog to ✅ Done in ApiView Mar 8, 2023
tjprescott added a commit that referenced this issue Mar 8, 2023
* Closes #3759.

* Display class decorators. Fixes #4860

* Fix #5197.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

2 participants