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
Update type annotations of PEP 695 nodes #2264
Update type annotations of PEP 695 nodes #2264
Conversation
These attributes cannot be none in real-world situations, see python/cpython#106145.
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2264 +/- ##
=======================================
Coverage 92.78% 92.78%
=======================================
Files 94 94
Lines 10951 10951
=======================================
Hits 10161 10161
Misses 790 790
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Reading the cpython issue it's unclear to me if it was possible it was None in 3.10 and isn't anymore of if this was never possible that it's None. We still need to support older python interpreter if that's the case. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I had this on my todo list, but didn't get around to it before going on holiday.
I'm trying to keep up with all the ongoing developments but it is quite hard. Feel free to tag me if I missed something in either project!
This was only possible in beta's, so making this required is fine imo! |
These were new nodes in 3.12, so there's no real-world code that we need to support without these linenos. |
Damn, you're really keeping pylint bleeding edge, love that ! |
These attributes cannot be none in real-world situations, see python/cpython#106145.
…s__ container (#2263) * Exclude type-annotated class attributes, which have no assigned value, from the ``__members__`` container of an ``Enum`` class. Refs pylint-dev/pylint#7402 * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix exising test. The value if now `Uninferable` in the case of an annotated attribute of an `enum.Enum` class with no assigned value. * Update astroid/brain/brain_namedtuple_enum.py Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> * Update tests. * Update test: Use `infer()` instead of `inferred()`. * Update type annotations of PEP 695 nodes (#2264) These attributes cannot be none in real-world situations, see python/cpython#106145. * Update sphinx requirement from ~=7.0 to ~=7.1 (#2265) Updates the requirements on [sphinx](https://github.com/sphinx-doc/sphinx) to permit the latest version. - [Release notes](https://github.com/sphinx-doc/sphinx/releases) - [Changelog](https://github.com/sphinx-doc/sphinx/blob/master/CHANGES) - [Commits](sphinx-doc/sphinx@v7.0.0...v7.1.1) --- updated-dependencies: - dependency-name: sphinx dependency-type: direct:production ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Ensure a node is inferred in the case when there is only one member. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Undo unintended changes. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Type of Changes
Description
Closes #2253
These attributes cannot be none in real-world situations, see python/cpython#106145.
@DanielNoord they were already required; we're just changing the type annotations, yes? It's not enforced anywhere in the code.