Skip to content

Conversation

@jorenham
Copy link
Owner

@jorenham jorenham commented Dec 7, 2025

The following protocols are no longer generic:

  • CanBytes
  • CanStr
  • CanIndex
  • CanRepr
  • CanFormat
  • CanDelattr
  • CanLen
  • CanLengthHint
  • CanBuffer

Additionally, CanGetattr, CanSetattr, and CanSetName had their first generic str-bound type parameter removed, so that now accept a single type arugment.
Similarly, this removes the last type-parameter of the CanContains and CanSequence protocols.

These changes were made because passing Literals as generic type arguments almost never works as intended in practice. One excpetion is CanBool, which has some use-cases, and is therefore left as a generic type.

@jorenham jorenham added this to the v0.15.0 milestone Dec 7, 2025
@jorenham jorenham changed the title remove literal generic type parameters remove literal generic type parameters of Can* Dec 7, 2025
@jorenham
Copy link
Owner Author

jorenham commented Dec 7, 2025

This doesn't seem to cause any issues for scipy-stubs, so in it goes

@jorenham jorenham merged commit fa2e560 into master Dec 7, 2025
24 checks passed
@jorenham jorenham deleted the no-literal-generics branch December 7, 2025 19:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant