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

Retire _AnyStr #71

Open
1 of 4 tasks
abelcheung opened this issue Nov 13, 2024 · 0 comments
Open
1 of 4 tasks

Retire _AnyStr #71

abelcheung opened this issue Nov 13, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@abelcheung
Copy link
Owner

abelcheung commented Nov 13, 2024

The alias _AnyStr has been traditionally used inside lxml-stubs to mean str | bytes, even before being cut off from typeshed. There isn't a big motivation yet to eliminate its usage so far, despite being easily confusable with typing.AnyStr.

Now that typing.AnyStr has been officially deprecated, and types-lxml is trying to update arguments where bytearray is applicable, the time might be appropriate to have _AnyStr gone for good. Even if an alias is desired, something like TextArg makes more sense and less likely mistaken as the deprecated TypeVar.

Tasks ahead

  • Search for places where _AnyStr is used for single purpose
    • attribute value comes to mind, especially inside SupportsLaxedItems mapping (233adc9)
  • For remaining usages, slowly test for bytearray and replace arguments
  • Maybe really create a TextArg alias for this purpose
@abelcheung abelcheung added the enhancement New feature or request label Nov 13, 2024
@abelcheung abelcheung moved this to In Progress in Types-lxml progress Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: In Progress
Development

No branches or pull requests

1 participant