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

Fix #308: Add __deepcopy__ method to the tz.TomlTz class #309

Merged
merged 1 commit into from
Oct 27, 2020
Merged

Fix #308: Add __deepcopy__ method to the tz.TomlTz class #309

merged 1 commit into from
Oct 27, 2020

Conversation

jpsca
Copy link
Contributor

@jpsca jpsca commented Aug 7, 2020

Without this method, the dict that results from parsing a datetime with a timezone cannot be deep-copied using the stdlib copy.deepcopy() function.

Example:

import copy
import toml

o = toml.loads("dob = 1979-05-27T07:32:00-08:00")
# {'dob': datetime.datetime(1979, 5, 27, 7, 32, tzinfo=<toml.tz.TomlTz object at 0x7f4782efb3d0>)}
copy.deepcopy(o)

This currently raises a TypeError.

@jpsca jpsca changed the title Add __deepcopy__ method to TomlTz class. Fix #308 Fix #308: Add __deepcopy__ method to the tz.TomlTz class Aug 7, 2020
Without this method, the dict that results from parsing a datetime
with a timezone cannot be deep-copied using the stdlib
`copy.deepcopy()` function.
@uiri
Copy link
Owner

uiri commented Oct 27, 2020

Thank you for your pull request! Merged.

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.

None yet

2 participants