Skip to content

Change optional boolean properties, such as deleted, to real booleans #1812

@kevinrenskers

Description

@kevinrenskers

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 would 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

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions