Skip to content

PYTHON-4690 Add repr for FixedOffset eg FixedOffset(datetime.timedelta(seconds=3600), '+60')) #1806

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

Merged
merged 3 commits into from
Aug 23, 2024

Conversation

ShaneHarvey
Copy link
Member

@ShaneHarvey ShaneHarvey commented Aug 21, 2024

PYTHON-4690

Motivation:
When working with multiple timezones, this change makes it easier to see which ones are being used.

Before:

>>> from bson.tz_util import FixedOffset, utc
>>> utc
<bson.tz_util.FixedOffset object at 0x104ec2840>
>>> FixedOffset(60, 'tzName')
<bson.tz_util.FixedOffset object at 0x104b0cc20>

After:

>>> from bson.tz_util import FixedOffset, utc
>>> utc
FixedOffset(datetime.timedelta(0), 'UTC')
>>> FixedOffset(60, 'tzName')
FixedOffset(datetime.timedelta(seconds=3600), 'tzName')

Related to PYTHON-4663.

@ShaneHarvey ShaneHarvey changed the title PYTHON-4663 Add repr for FixedOffset eg FixedOffset(datetime.timedelta(seconds=3600), '+60')) PYTHON-4690 Add repr for FixedOffset eg FixedOffset(datetime.timedelta(seconds=3600), '+60')) Aug 22, 2024
@ShaneHarvey ShaneHarvey marked this pull request as ready for review August 22, 2024 23:02
Copy link
Member

@blink1073 blink1073 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@ShaneHarvey ShaneHarvey merged commit 4eae7d2 into mongodb:master Aug 23, 2024
34 checks passed
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.

2 participants