Skip to content

[braintree] VisaCheckoutCard.expiration_date can return None - #16867

Open
ArthDubey1011 wants to merge 1 commit into
python:mainfrom
ArthDubey1011:none-braintree
Open

ArthDubey1011 wants to merge 1 commit into
python:mainfrom
ArthDubey1011:none-braintree

Conversation

@ArthDubey1011

@ArthDubey1011 ArthDubey1011 commented Nov 19, 2026 •

Copy link
Copy Markdown

VisaCheckoutCard.expiration_date returns None when the expiration month or year is missing (source):

@property

def expiration_date(self):

    if not self.expiration_month or not self.expiration_year:

        return None

    return self.expiration_month + "/" + self.expiration_year

CreditCard, MetaCheckoutCard and MetaCheckoutToken already annotate the same property as str | None. Checked with braintree 4.47.0:

>>> VisaCheckoutCard(None, {"expiration_month": "", "expiration_year": "2030"}).expiration_date is None

True

AI assistance: Claude Code (Claude Opus 5.5) found this by comparing the stubs with the runtime source, ran the check above and made the edit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant