[Python-Dev] Re: Inadequate error reporting during function call setup stage

2021-02-22 Thread Peter Otten
On 21/02/2021 23:06, Terry Reedy wrote: On 2/21/2021 12:04 PM, Paul Sokolovsky wrote: Traceback (most recent call last):    File "pseudoc_tool.py", line 91, in first_class_function_value(func, **pass_params) TypeError: print() got an unexpected keyword argument 'noann' This is not typic

Re: [Python-Dev] python2.7 infinite recursion when loading pickled object

2014-08-11 Thread Peter Otten
Chris Angelico wrote: > On Mon, Aug 11, 2014 at 9:40 PM, Peter Otten <__pete...@web.de> wrote: >> Read again. The OP tries to delegate attribute lookup to an (existing) >> attribute. >> >> IMO the root cause of the problem is that pickle looks up __dunder__ >&

Re: [Python-Dev] python2.7 infinite recursion when loading pickled object

2014-08-11 Thread Peter Otten
Terry Reedy wrote: > On 8/11/2014 5:10 AM, Schmitt Uwe (ID SIS) wrote: > > Python usage questions should be directed to python-list, for instance. > >> I discovered a problem using cPickle.loads from CPython 2.7.6. > > The problem is your code having infinite recursion. You only discovered > it

[Python-Dev] Function to handle None in sort operation, was Re: python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Peter Otten
M.-A. Lemburg wrote: > IMO, it was a mistake to have None return a TypeError in > comparisons, since it makes many typical data operations > fail, e.g. > > Python2: l = [1,2,None,4,5,None,6] l.sort() l > [None, None, 1, 2, 4, 5, 6] > > Python3: l = [1,2,None,4,5,None,6]

Re: [Python-Dev] type.__subclasses__() doesn't work

2013-10-09 Thread Peter Otten
Steven D'Aprano wrote: > On Wed, Oct 09, 2013 at 12:20:18PM +0200, Antoine Pitrou wrote: >> >> Hello, >> >> Just noticed the following quirk: >> >> >>> type.__subclasses__() >> Traceback (most recent call last): >> File "", line 1, in >> TypeError: descriptor '__subclasses__' of 'type' objec

Re: [Python-Dev] experimental: Misc/NEWS included in docs

2012-09-30 Thread Peter Otten
Georg Brandl wrote: > at http://docs.python.org/3.3/whatsnew/news.html, there is now > a rendering of Misc/NEWS with tracker links and a crude filtering > capability. I thought that this will complement the "whatsnew" > documents nicely for people looking for more detail. > > Please let me know

Re: [Python-Dev] Should urlencode() sort the query parameters (if they come from a dict)?

2012-08-18 Thread Peter Otten
Guido van Rossum wrote: > I wonder if it wouldn't make sense to change urlencode() to generate > URLs that don't depend on the hash order, for all versions of Python > that support PYTHONHASHSEED? It seems a one-line fix: > > query = query.items() > > with this: > > query = sorted(query.items()

Re: [Python-Dev] Checking if unsigned int less then zero.

2012-06-22 Thread Peter Otten
Dmitriy Tochansky wrote: > Playing with cpython source, I found some strange strings in > socketmodule.c: > > --- > if (flowinfo < 0 || flowinfo > 0xf) { > PyErr_SetString( > PyExc_OverflowError, > "getsockaddrarg: flowinfo must be 0-104

Re: [Python-Dev] Playing with a new theme for the docs, iteration 2

2012-03-25 Thread Peter Otten
Serhiy Storchaka wrote: >> * Maybe the Next/Previous Page headers on the left could link to the >> respective page. > > Do you mean next/previous links in header/footer? No, I mean the two sections in the sidebar on the left, below "Table of Contents".

Re: [Python-Dev] Playing with a new theme for the docs, iteration 2

2012-03-25 Thread Peter Otten
Georg Brandl wrote: > Here's another try, mainly with default browser font size, more contrast > and collapsible sidebar again: > > http://www.python.org/~gbrandl/build/html2/ Nice! Lightweight and readable. >From the bikeshedding department: * Inlined code doesn't need the gray background. Th

Re: [Python-Dev] Python3 regret about deleting list.sort(cmp=...)

2011-03-12 Thread Peter Otten
Guido van Rossum wrote: > I was just reminded that in Python 3, list.sort() and sorted() no > longer support the cmp (comparator) function argument. The reason is > that the key function argument is always better. But now I have a > nagging doubt about this: > > I recently advised a Googler who w

Re: [Python-Dev] Rethinking intern() and its data structure

2009-04-10 Thread Peter Otten
John Arbash Meinel wrote: > Not as big of a difference as I thought it would be... But I bet if > there was a way to put the random shuffle in the inner loop, so you > weren't accessing the same identical 25k keys internally, you might get > more interesting results. You can prepare a few random

Re: [Python-Dev] [Python-checkins] python/dist/src/Lib urllib.py, 1.169, 1.170

2005-09-10 Thread Peter Otten
Am Samstag, 10. September 2005 04:27 schrieb [EMAIL PROTECTED]: > Update of /cvsroot/python/python/dist/src/Lib > In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3622 > > Modified Files: > urllib.py > Log Message: > Simplify and speed-up quote_plus(). > > Index: urllib.py > ===