[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Armin Ronacher added the comment: Yes. Appears to be related. -- ___ Python tracker <http://bugs.python.org/issue6945> ___ ___ Python-bugs-list mailin

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Changes by Armin Ronacher : -- nosy: +aronacher ___ Python tracker <http://bugs.python.org/issue3976> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Armin Ronacher added the comment: Duplicate of #3976 -- resolution: -> duplicate ___ Python tracker <http://bugs.python.org/issue6945> ___ ___ Python-bugs-lis

[issue6945] pprint.pprint does not pprint unsortable dicts in Python 3

2009-09-20 Thread Armin Ronacher
Changes by Armin Ronacher : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue6945> ___ ___ Python-bugs-list mailing list Unsubscri

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Armin Ronacher added the comment: @Georg: Instead of catching a TypeError i would rather call __gt__ / __lt__ directly and check for NotImplemented. Python 2.x did not catch TypeErrors either. -- ___ Python tracker <http://bugs.python.

[issue3976] pprint._safe_repr is not general enough in one instance

2009-09-20 Thread Armin Ronacher
Armin Ronacher added the comment: Eg, something like this: class safe_key(object): __slots__ = ('obj',) def __init__(self, obj): self.obj = obj def __eq__(self, other): return self.obj.__eq__(other.obj) def __lt__(self, other): rv = self.

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
New submission from Armin Ronacher : In 2.6 a deprecation warning was added if `object.__new__` was called with arguments. Per se this is fine, but the detection seems to be faulty. The following code shows the problem: >>> class A(object): ... def __new__(self): ...

[issue5322] Python 2.6 object.__new__ argument calling autodetection faulty

2009-02-19 Thread Armin Ronacher
Armin Ronacher added the comment: The problem seems to be caused by tp_new being slot_tp_new which then invokes whatever __new__ in the class dict is. I'm not so sure what would be the solution to this. One could of course check if tp_new is either object_new or slot_tp_new and in the l

[issue5381] json need object_pairs_hook

2009-02-27 Thread Armin Ronacher
Armin Ronacher added the comment: Motivation: Yes. JSON says it's unordered. However Hashes in Ruby are ordered since 1.9 and they were since the very beginning in JavaScript and PHP. -- nosy: +aronacher ___ Python tracker

[issue5397] PEP 372: OrderedDict

2009-03-01 Thread Armin Ronacher
Armin Ronacher added the comment: @Georg > * eval()ing the repr() will not construct the dict in the same order The alternative would be a list of dicts inside the constructor call, but that feels ugly. defaultdict from the same module is not evaluable at all, so I guess it wouldn't

[issue5401] mimetypes.MAGIC_FUNCTION implementation clusterfuck

2009-03-01 Thread Armin Ronacher
New submission from Armin Ronacher : Sorry for the harsh words, but when I found that code I nearly freaked out. For all those years I was using "from mimetypes import guess_type" until today I found out that this has horrendous performance problems due to the fact that the mimetype d

[issue5401] mimetypes.MAGIC_FUNCTION performance problems

2009-03-01 Thread Armin Ronacher
Changes by Armin Ronacher : -- title: mimetypes.MAGIC_FUNCTION implementation clusterfuck -> mimetypes.MAGIC_FUNCTION performance problems ___ Python tracker <http://bugs.python.org/iss

[issue1355826] shutil.move() does not preserve ownership

2009-03-02 Thread Armin Ronacher
Armin Ronacher added the comment: While this is surprising, this is documented behavior: "If the destination is on the current filesystem, then simply use rename. Otherwise, copy src (with copy2()) to the dst and then remove src." And copy2() uses copystat() and does not copy "

[issue5405] There is no way of determining which ABCs a class is registered against

2009-03-02 Thread Armin Ronacher
Armin Ronacher added the comment: I don't think this can be solved. Not only do registered classes not show up (which could be fixed by providing something like inspect.getfakemro) but ABCs can also perform duck-type checks. For example a class with an __iter__ method is an instan

[issue5405] There is no way of determining which ABCs a class is registered against

2009-03-02 Thread Armin Ronacher
Armin Ronacher added the comment: I suppose it would be a good idea to fix part of that problem in Sphinx (and probably also in pydoc) by adding something like ":implements: MutableMapping" in the docstring. So that this is explicitly added to the docstring and conforming tools ca

[issue5397] PEP 372: OrderedDict

2009-03-02 Thread Armin Ronacher
Armin Ronacher added the comment: Maybe premature optimization but maybe it would make sense to implement __eq__ like this: def __eq__(self, other): if isinstance(other, OrderedDict): if not dict.__eq__(self, other): return False return all(p == q for p, q in

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Armin Ronacher added the comment: Please no. We just decided to *not* extend the API. The PEP originally had a well designed list of dict API extensions that already provided exactly that. If we really want to provide access to that, we can roll back to where we came from. I don't

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Armin Ronacher added the comment: Please no. We just decided to *not* extend the API. The PEP originally had a well designed list of dict API extensions that already provided exactly that. If we really want to provide access to that, we can roll back to where we came from. I don't

[issue5397] PEP 372: OrderedDict

2009-03-03 Thread Armin Ronacher
Changes by Armin Ronacher : ___ Python tracker <http://bugs.python.org/issue5397> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/o

[issue9368] Const-Correctness for Method Calls

2010-07-24 Thread Armin Ronacher
New submission from Armin Ronacher : The following patch changes some parts of the public C API for const correctness which would help C++ programmers. The original patch was provided by neXyon on irc.freenode.net. It does not produce any compiler warnings on GCC and I don't expec

[issue27589] asyncio doc: issue in as_completed() doc

2016-11-08 Thread Armin Ronacher
Armin Ronacher added the comment: I am not even sure what the function is supposed to tell me. The documentation is very unclear and the example code does not help. What is "fs" for instance? And why would it return things that are not from fs? -- nosy:

<    1   2