Gareth Rees added the comment:
This is a duplicate of #22180, which was fixed in changeset 9c250f34bfa3 by
Raymond Hettinger in branch '3.4'. The fix just removes the bad example, as in
my patch. So I suggest that this issue be closed as a
New submission from Gareth Rees:
The "Expressions" documentation contains the text:
> * Sets and frozensets define comparison operators to mean subset and superset
> tests. Those relations do not define total orderings (the two sets ``{1,2}``
> and {2,3} are not equal,
New submission from Gareth Rees:
The "Built-in Types" section of the library documentation does not explain how
two dictionaries are compared for equality.
The place where this is documented is under "Comparisons" in the Language
Reference:
> Mappings (dictionaries) co
Changes by Gareth Rees :
--
title: "Bulit-in Types" documentation doesn't explain how dictionaries are
compared for equality -> "Built-in Types" documentation doesn't explain how
dictionaries are compared for equality
Gareth Rees added the comment:
If you read the documentation for urllib.parse.urlencode [1], you'll
see that it says:
The value element in itself can be a sequence and in that case, if
the optional parameter doseq is evaluates to True, individual
key=value pairs separated by
Gareth Rees added the comment:
Not just Iterator, but Container, Hashable, Iterable, and Sized too!
>>> import weakref
>>> class C: pass
>>> o = C()
>>> w = weakref.proxy(o)
>>> from collections.abc import *
>>>
Gareth Rees added the comment:
Hashable is particularly misleading, because "weakref.Proxy objects are not
hashable regardless of the referent".
--
___
Python tracker
<http://bugs.python.o
Gareth Rees added the comment:
The documentation says that weakref.Proxy objects are not hashable because
"this avoids a number of problems related to their fundamentally mutable
nature, and prevent their use as dictionary keys".
Hashable objects must be immutable, otherwise the
Gareth Rees added the comment:
> I don't see any reason for proxy objects to be less hashable than ref objects.
The difference is that unlike a ref object, a proxy object is supposed to
forward its method calls to the proxied object. So consider what happens if you
forward the __hash_
Gareth Rees added the comment:
The output of "python3.5 --help" says:
-u : unbuffered binary stdout and stderr, stdin always buffered;
also PYTHONUNBUFFERED=x
see man page for details on internal buffering relating to '-u'
If you look at the man pag
Gareth Rees added the comment:
Here's a patch that copies the text for the -u option from the man page to the
--help output.
--
keywords: +patch
Added file: http://bugs.python.org/file45463/issue28647.patch
___
Python tracker
New submission from Gareth Rees:
On macOS Sierra (OSX 10.12.1):
$ ./configure --with-pydebug && make
[... lots of output omitted ...]
gcc -c -Wno-unused-result -Wsign-compare -g -O0 -Wall -Wstrict-prototypes
-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter
-Wno
Gareth Rees added the comment:
This is a well-known gotcha with backtracking regexp implementations. The
problem is that in the alternation "( +|'[^']*'|\"[^\"]*\"|[^>]+)" there are
some characters (space, apostrophe, double quotes) that match
Gareth Rees added the comment:
Couldn't the test case use something like this to avoid allocating so much
memory?
from collections.abc import Sequence
class RepeatedSequence(Sequence):
"""Immutable sequence of n repeats of elem."""
Gareth Rees added the comment:
In order for this to work, the __getitem__ method needs to be:
def __getitem__(self, key):
if 0 <= key < self.n:
return self.elem
else:
raise IndexError(key)
But unfortunately this is very bad for the performance
101 - 115 of 115 matches
Mail list logo