Skip to content

Conversation

brianschubert
Copy link
Member

Add tests to exercise some previously unexercised lines:

  • _SpecialGenericAlias.__setattr__() for non-dunder, non-"allowed" attributes (src)
  • Wrong number of type arguments given to a _SpecialGenericAlias from without defaults (src)
  • Attempting to specialize a _SpecialGenericAlias with 0 type parameters (src)
  • Setting <thing>.__module__ on Python implementations that don't supply sys._getframemodulename or sys._getframe (src)
  • Calling get_type_hints() with types.GenericAlias (src)
  • Exception raised by __init_subclass__() of ParamSpec (src)
  • The methods __or__() and __ror__() of _SpecialForm (src)
  • The methods __repr__ and __reduce__ of NoExtraItems (test case copied from NoDefaultTests) (src)

Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, thank you!

@brianschubert
Copy link
Member Author

Thanks for the review! I pushed a few changes. re: making ParamSpec.__init_subclass__ raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry

Copy link
Contributor

@Daraan Daraan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

making ParamSpec.init_subclass raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry.

Imo, it's worth noting. That it is now consistent with the other versions.

@AlexWaygood
Copy link
Member

Thanks for the review! I pushed a few changes. re: making ParamSpec.__init_subclass__ raise in the 3.9 implementation, would this be worth a changelog mention? For reference, the 3.10+ implementation started raising in #165, which didn't include a changelog entry

Probably worth it, just to be safe? I feel like #165 probably should have had a changelog mention too if it changed behaviour 😄

brianschubert and others added 4 commits August 30, 2025 13:30
Co-authored-by: Alex Waygood <alex.waygood@gmail.com>
Co-authored-by: Daraan <github.blurry@9ox.net>
Copy link
Member

@AlexWaygood AlexWaygood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! I think there's a merge conflict

@AlexWaygood AlexWaygood merged commit ccbfd9b into python:main Aug 30, 2025
23 checks passed
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.

3 participants