-
Notifications
You must be signed in to change notification settings - Fork 524
Change optional boolean properties, such as deleted, to real booleans #1812
Open
Labels
Description
Is your feature request related to a problem? Please describe.
Whenever a StripeObject subclass has the deleted property, it's optional and can ever only be True:
deleted: Optional[Literal[True]] """ Always true for a deleted object """
This means that if I want to check if a customer was deleted for example, I need to use getattr(customer, "deleted", False) instead of simply customer.deleted (because that could raise an AttributeError).
Describe the solution you'd like
Now that StripeObject isn't simply a subclass of dict anymore, can't the SDK simplify these sort of booleans? Turn them from optional booleans that can only be True to real booleans?
Describe alternatives you've considered
No response
Additional context
No response
Metadata
Metadata
Assignees
Labels
Type
Fields
Give feedbackNo fields configured for issues without a type.