[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 (23-compatible): --- start code --- class MyDate(datetime): @classmethod def fromDT(cls, d): :type d: datetime return cls(d.year, d.month, d.day, d.hour, d.minute, d.second, d.microsecond, d.tzinfo

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

2015-02-11 Thread Edward O
Changes by Edward O edoubray...@gmail.com: -- nosy: +eddygeek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20371 ___ ___ Python-bugs-list mailing

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

2014-10-07 Thread Edward O
Changes by Edward O edoubray...@gmail.com: -- nosy: +BreamoreBoy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22294 ___ ___ Python-bugs-list

[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

[issue7434] general pprint rewrite

2014-09-19 Thread Edward O
Changes by Edward O edoubray...@gmail.com: -- nosy: +eddygeek ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7434 ___ ___ Python-bugs-list mailing

[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) in constract

[issue22297] 2.7 json encoding broken for enums

2014-08-29 Thread Edward O
Changes by Edward O edoubray...@gmail.com: -- title: json encoding broken for - 2.7 json encoding broken for enums ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22297

[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, self.nodes)) + 1

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

2014-08-28 Thread Edward O
Changes by Edward O edoubray...@gmail.com: -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22294 ___ ___ Python-bugs

[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 rep...@bugs.python.org http