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

Add DateTime to typing for diff() #823

Open
cp2boston opened this issue May 16, 2024 · 0 comments
Open

Add DateTime to typing for diff() #823

cp2boston opened this issue May 16, 2024 · 0 comments

Comments

@cp2boston
Copy link

  • [ x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [ x] I have searched the documentation and believe that my question is not covered.

Feature Request

This doesn't affect operations, but it does cause my linter to flag. The diff method:
`
def diff( # type: ignore[override]
self, dt: datetime.datetime | None = None, abs: bool = True
) -> Interval:
"""
Returns the difference between two DateTime objects represented as an Interval.
"""
if dt is None:
dt = self.now(self.tz)

    return Interval(self, dt, absolute=abs)

`
will complain if the dt type is a Pendulum DateTime object.

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

No branches or pull requests

1 participant