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

feat!: annotate types #761

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

kdmccormick
Copy link
Member

@kdmccormick kdmccormick commented Jun 10, 2024

WIP. Will supersede #713

Test sandbox: openedx/edx-platform#35236

_AutoNamedFieldsMetaclass was a hand-rolled way of capturing each
Field's name as it is defined on an XBlock. Since Python 3.6,
__set_name__ is part of the built-in Descriptor interface, providing
a more elegant way of achieving the same thing.
Without --keep-going, 'make html' showed a single error at a time.
With --keep-going, 'make html' shows them all in one big list.
(Either way, the build would fail if there are any warnings, as desired.)
WIP: annotate xblock/runtime.py
WIP: remove XBlock mixin from hierarchy, just use asserts, for backcompat?
WIP: DEPR non-string usage and definition keys?

BREAKING CHANGE: [Developers only]
Type-checked Python code using the XBlock API will likely need to be
updated in order to continue passing type-checking, since XBlock's
new annotations will trigger mypy (et al) to behave much more strictly.

NO BREAKING CHANGES for site operators, authors, learners, etc.
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

Successfully merging this pull request may close these issues.

1 participant