GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Pendulum `interval` seems incompatible with Python native `datetime` · Issue #906 · python-pendulum/pendulum Open Labels Milestone Description
IssueI'm new to Set upThe documentation advertises compatibility with native Python >>> from datetime import datetime >>> import pendulum >>> dt = pendulum.datetime(2015, 2, 5) >>> isinstance(dt, datetime) True So I thought I could do this: start_time = datetime(2025, 7, 25, 19, 26, 34) end_time = datetime(2025, 7, 29, 19, 26, 34) interval = pendulum.interval(start_time, end_time) Unexpected behaviourIt turns out I can't: >>> interval.in_words() '3 days 4 hours 33 minutes' >>> interval.days 4 >>> interval.hours 4 >>> interval.minutes 33 >>> interval.in_days() 4 >>> interval.in_hours() / 24 4.0 I now understand that I should've started with: start_time = pendulum.datetime(2025, 7, 25, 19, 26, 34) end_time = pendulum.datetime(2025, 7, 29, 19, 26, 34) or start_time = pendulum.instance(start_time) end_time = pendulum.instance(end_time) But still, the above behaviour is extremely confusing, unless I'm missing something of course. Expected behaviourI personally would expect
Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |