[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2015-02-11 Thread Edward O
Edward O added the comment: Here is a workaround for subclasses (2&3-compatible): --- start code --- class MyDate(datetime): @classmethod def fromDT(cls, d): """ :type d: datetime """ return cls(d.year, d.month, d.day, d.hour,

[issue20371] datetime.datetime.replace bypasses a subclass's __new__

2015-02-11 Thread Edward O
Changes by Edward O : -- nosy: +eddygeek ___ Python tracker <http://bugs.python.org/issue20371> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22297] 2.7 json encoding broken for enums

2014-10-07 Thread Edward O
Edward O added the comment: The arguments for fixing: * int subclasses overriding str is a very common usecase for enums (so much so that it was added to stdlib in 3.4). * json supporting a standard type of a subsequent python version, though not mandatory, would be beneficial to Py2/Py3

[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange

2014-10-07 Thread Edward O
Changes by Edward O : -- nosy: +BreamoreBoy ___ Python tracker <http://bugs.python.org/issue22294> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue7434] general pprint rewrite

2014-09-19 Thread Edward O
Changes by Edward O : -- nosy: +eddygeek ___ Python tracker <http://bugs.python.org/issue7434> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22297] 2.7 json encoding broken for enums

2014-08-29 Thread Edward O
Changes by Edward O : -- title: json encoding broken for -> 2.7 json encoding broken for enums ___ Python tracker <http://bugs.python.org/issue22297> ___ ___ Py

[issue22297] json encoding broken for

2014-08-29 Thread Edward O
New submission from Edward O: _make_iterencode in python2.7/json/encoder.py encodes custom enum types incorrectly (the label will be printed without '"') because of these lines (line 320 in 2.7.6): elif isinstance(value, (int, long)): yield buf + str(value

[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange

2014-08-28 Thread Edward O
Changes by Edward O : -- nosy: +benjamin.peterson ___ Python tracker <http://bugs.python.org/issue22294> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22294] 2to3 consuming_calls: len, min, max, zip, map, reduce, filter, dict, xrange

2014-08-28 Thread Edward O
New submission from Edward O: This is a patch for issues similar to #16573 With this patch, the following new tests are now unchanged: r = dict(zip(s, range(len(s))), **d) r = len(filter(attrgetter('t'), self.a)) r = min(map(methodcaller('f'), self.a)) max(map(node.id,

[issue22005] datetime.__setstate__ fails decoding python2 pickle

2014-07-21 Thread Edward O
Edward O added the comment: The code works when using encoding='bytes'. Thanks Tim for the suggestion. So this is not a bug, but is there any sense in having encoding='ASCII' by default in pickle ? -- ___ Python tracker <