Skip to content

Move datetime-specific code from date methods into datetime class - #154

Merged
hramezani merged 1 commit into
slashmili:mainfrom
5j9:split-dt-specific
Apr 7, 2024
Merged

hramezani merged 1 commit into
slashmili:mainfrom
5j9:split-dt-specific

Conversation

@5j9

@5j9 5j9 commented Apr 7, 2024

Copy link
Copy Markdown
Contributor

Simplifies the logic and improves readability by moving datetime-specific code branches to datetime class.
Also resolves some code linter warnings about attributes not being defined on date class.

_strftime_p: only raises Exception (AttributeError) on date objects because dates do not have hour attribute.

_strftime_z: only raises AttributeError on a date class becuase date does not have utcoffset attribute.

_strftime_cap_z: date does not have tzname attribute, but datetime has.

@hramezani

Copy link
Copy Markdown
Collaborator

@5j9 please rebase on top of main

_strftime_p: only raises Exception (AttributeError) on date objects
because dates do not have hour attribute.

_strftime_z: only raises AttributeError on a date class becuase
date does not have utcoffset attribute.

_strftime_cap_z: date does not have tzname attribute, but
datetime has.
@hramezani

Copy link
Copy Markdown
Collaborator

Thanks @5j9

@hramezani
hramezani merged commit 06352d5 into slashmili:main Apr 7, 2024
@5j9
5j9 deleted the split-dt-specific branch April 8, 2024 02:36
@slashmili

Copy link
Copy Markdown
Owner

Nice work @5j9 👍🏼

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.

3 participants