kennethreitz / maya

Datetimes for Humans™
MIT License
3.41k stars 199 forks source link

Inconsistency between date and datetime #176

Open jonathan-s opened 5 years ago

jonathan-s commented 5 years ago

The following code.

mayaobj = maya.parse('12/12/12')
print(mayaobj.datetime())
print(mayaobj.date)

Date requires a method, whereas date is a property. In my humble opinion it would be better if both were a method or both were a property.

ashwineaso commented 5 years ago

But the intention is that mayaobj.datetime() returns a timezone aware/ not aware MayaDT object (based on the arguments passed), and date is a property of it. So the current implementation is accurate. Right?

timofurrer commented 5 years ago

@ashwineaso that's kinda correct. However, the date, day, month, ..., properties actually take the date() from the datetime() method. So that's also timezone aware and part of the datetime().

So I think I agree with @jonathan-s, but don't really want to break the interface - any other opinions?

jonathan-s commented 5 years ago

Well, if you decide to break the interface I would suggest to do it in a major version release. Feels like that’s the only time it would be justifiable to make a change like that.

On Sun 7. Jul 2019 at 11:22, Timo Furrer notifications@github.com wrote:

@ashwineaso https://github.com/ashwineaso that's kinda correct. However, the date, day, month, ..., properties actually take the date() from the datetime() method. So that's also timezone aware and part of the datetime().

So I think I agree with @jonathan-s https://github.com/jonathan-s, but don't really want to break the interface - any other opinions?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/kennethreitz/maya/issues/176?email_source=notifications&email_token=AAQGYEXSR5LSQ3GOSENQU53P6GYT5A5CNFSM4HPC6XJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODZLH2GQ#issuecomment-508984602, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQGYESB5ATX7YWJFJHOEU3P6GYT5ANCNFSM4HPC6XJA .

-- Sent from Gmail Mobile

timofurrer commented 5 years ago

Yes, that's for sure. maya isn't even in a API stable release yet - we still have that zero as major version ;)

I'll check the usages on GitHub - I'll get back to it.

github-actions[bot] commented 4 years ago

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

jonathan-s commented 4 years ago

Still valid in my opinion.

On Fri 6. Sep 2019 at 10:01, github-actions[bot] notifications@github.com wrote:

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/timofurrer/maya/issues/176?email_source=notifications&email_token=AAQGYESTAZHWSP6PLS2U7UTQIIE4VA5CNFSM4HPC6XJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD6CCPUQ#issuecomment-528754642, or mute the thread https://github.com/notifications/unsubscribe-auth/AAQGYEV6IT4M77LIVVWM7STQIIE4VANCNFSM4HPC6XJA .

-- Sent from Gmail Mobile

timofurrer commented 4 years ago

That's why I removed the label ;)

github-actions[bot] commented 4 years ago

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

github-actions[bot] commented 4 years ago

This Issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days