[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2018-07-05 Thread Paul Ganssle
Change by Paul Ganssle : -- nosy: +p-ganssle ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2016-09-18 Thread Mark Dickinson
Changes by Mark Dickinson : -- nosy: -mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2016-09-10 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- versions: +Python 3.7 -Python 3.3 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
Eric Snow added the comment: I'm doing some string-based serialization of datetimes and need to be able to specify the type somewhat declaratively. So I'm using a datetime subclass. This is more or less the code I'm using: class Timestamp(datetime.datetime): def __new__(cls, raw_value,

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Eric, Could you share details of your use-case? My experience with subclassing from basic python types including date/time has been mostly negative. The problem is that when I subclass, I want to inherit the rich set of operations such as +, -, *, etc

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2013-08-12 Thread Eric Snow
Eric Snow added the comment: This bit me today (under 2.7). -- nosy: +eric.snow ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2011-01-11 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- keywords: -patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://ma

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-12-01 Thread Alexander Belopolsky
Changes by Alexander Belopolsky : -- resolution: -> postponed versions: +Python 3.3 -Python 3.2 ___ Python tracker ___ ___ Python-bugs

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-06-25 Thread Nick Coghlan
Nick Coghlan added the comment: If you can articulate the benefits of splitting them apart, it would be worth making the case for doing so on python-dev. I'm having a hard time picturing what anyone could be doing such that it would break their code, but it's still definitely a backwards inco

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-06-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Deprecating the feature for 3.x is certainly an option. > May be a little drastic though. How drastic would be to stop subclassing datetime from date in 3.2? After all, we don't subclass float form int. -- ___

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Nick Coghlan
Nick Coghlan added the comment: Deprecating the feature for 3.x is certainly an option. May be a little drastic though. -- ___ Python tracker ___ ___

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Ray.Allen
Ray.Allen added the comment: Date and Datetime comparison is not defined and not documented, and until we find a nice way to implement the comparison, we should just let this comparison raise NotImpelemented. -- nosy: +ysj.ray ___ Python tracker <

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Nick Coghlan
Nick Coghlan added the comment: I'd suggest leaving it open - the current situation is definitely suboptimal, but it is likely to take some close scrutiny to get it to behave nicely. -- ___ Python tracker

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > Could you provide some reasoning for such a resolution? > I had thought that "won't fix" indicated that the issue > wasn't actually an error in behavior. No, that would be "invalid." IMO, "won't fix" is for bugs were cost of fixing them outweighs the

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Jess Austin
Jess Austin added the comment: Could you provide some reasoning for such a resolution? I had thought that "won't fix" indicated that the issue wasn't actually an error in behavior. I grant that most people will never see this particular error, but it is an error. -- ___

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-05-25 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I am leaning towards "won't fix". Any objections? -- assignee: -> belopolsky nosy: +belopolsky -Alexander.Belopolsky versions: -Python 2.5, Python 2.6 ___ Python tracker _

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-28 Thread Nick Coghlan
Nick Coghlan added the comment: I think I'll concur with the "this is a mess" assessment. Given that state of affairs, punting on this until 3.2 (at the earliest). -- assignee: ncoghlan -> versions: +Python 3.2 -Python 2.4, Python 2.7, Python 3.0, Python 3.1 _

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: On Wed, Apr 21, 2010 at 2:33 PM, Jess Austin wrote: .. > It might seem like the latter behavior is marginally better, but really this > is just a mess, since a date-datetime comparison TypeErrors in all > directions.  I appreciate Alexander's more experi

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Jess Austin
Jess Austin added the comment: To be systematic, without the patch: >>> D(1900, 1, 1) > DT(1900, 1, 1) False >>> D(1900, 1, 1) < DT(1900, 1, 1) False >>> DT(1900, 1, 1) > D(1900, 1, 1) Traceback (most recent call last): File "", line 1, in TypeError: can't compare DT to D >>> DT(1900, 1, 1)

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- nosy: +mark.dickinson ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Upon further reflection I am -1 on this patch. First, as implemented this patch changes behavior of an explicit invocation of date.__eq__. The patch proposes to remove the following tests: -# Neverthelss, comparison should work with the base-c

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-04-21 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: There is another inconsistency that this patch does not seem to cure. With patch applied and D and DT defined as in OP, >>> D(1900,1,1) > DT(1900,1,1) True but >>> DT(1900,1,1) < D(1900,1,1) Traceback (most recent call last): File "", line 1, in Ty

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2010-01-13 Thread Nick Coghlan
Changes by Nick Coghlan : -- assignee: -> ncoghlan nosy: +ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2009-03-26 Thread Jack Diederich
Jack Diederich added the comment: +1 Patch and tests work for me. Uploaded a patch that is identical except the file paths are fixed. Was the old behavior stable across compilers anyway? It memcmpared two different structs and IIRC only the first item of each struct is guaranteed to be at th

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2009-03-23 Thread Jess Austin
Jess Austin added the comment: The attached patch fixes this issue, and updates the tests. Contrary to my initial impression, it seems that a previous developer knew of this behavior and thought it correct; see the comment of the test I deleted. I left memcmp() in. -- keywords: +patch

[issue5516] equality not symmetric for subclasses of datetime.date and datetime.datetime

2009-03-18 Thread Jess Austin
Changes by Jess Austin : -- title: equality not reflexive for subclasses of datetime.date and datetime.datetime -> equality not symmetric for subclasses of datetime.date and datetime.datetime ___ Python tracker __