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

Create a type alias for stripe.TaxId.type and others #1324

Open
hofrob opened this issue May 8, 2024 · 3 comments
Open

Create a type alias for stripe.TaxId.type and others #1324

hofrob opened this issue May 8, 2024 · 3 comments

Comments

@hofrob
Copy link

hofrob commented May 8, 2024

Is your feature request related to a problem? Please describe.

I want to re-use the long list of VAT types for my internal methods. Currently, they are copy pasted throughout the library. This means there's no way to just re-use them as a type alias.

Describe the solution you'd like

Create a typing.TypeAlias with the string literals and expose it.

Describe alternatives you've considered

Creating a type alias from the existing class properties did not work. This might be because of my limited understanding of how type hints can be re-used or extracted from external libraries.

Additional context

No response

@hofrob
Copy link
Author

hofrob commented May 8, 2024

It might make sense to rewrite these methods to use StrEnums instead.

@xavdid-stripe
Copy link
Contributor

Thanks for flagging! This is something I'll look into.

@xavdid-stripe
Copy link
Contributor

@hofrob Can you tell us more about your use case here? You're correct that it's not easy to extract that type, but it's something we can probably surface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants