Matteo Dell'Amico added the comment:
Personally, I'd find a maxheap in the standard library helpful, and a quick
Google search tells me I'm not alone.
I generally have to deal with numeric values, so I have these choices:
- ugly code (e.g., `minus_distance, elem = heappop(he
Matteo Dell'Amico added the comment:
Sorry for taking so long to answer, I didn't see notifications somehow.
Raymond, my use case is in general something that happens when I'm doing
analytics on sequences of events (e.g., URLs visited by a browser) or paths in
a graph. I lo
New submission from Matteo Dell'Amico :
I use itertools.pairwise all the time and I wonder if the same happens to
others. I'm thinking that others may be in the same situation, and having this
simple recipe already included in the library would be definitely more
convenient than co
Changes by Matteo Dell'Amico :
--
nosy: +della
___
Python tracker
<http://bugs.python.org/issue24068>
___
___
Python-bugs-list mailing list
Unsubscr
New submission from Matteo Dell'Amico :
Is there a way to define an abstract classmethod? The two obvious ways
don't seem to work properly.
Python 3.0.1+ (r301:69556, Apr 15 2009, 17:25:52)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or &q
Matteo Dell'Amico added the comment:
I suggest solving the problem by changing the implementation to:
def __iand__(self, c):
self -= self - c:
or to
def __iand__(self, c):
for item in self - c:
self.discard(item)
--
___
P
New submission from Matteo Dell'Amico :
The current MutableSet.__iand__ implementation calls self.discard while
iterating on self. This creates strange problems while implementing
MutableSet with simple choices. For example, consider the attached file
which implements set by delegating eith
Matteo Dell'Amico added the comment:
great Raymond! :)
___
Python tracker
<http://bugs.python.org/issue5350>
___
___
Python-bugs-list mailing list
Unsubsc
New submission from Matteo Dell'Amico :
The str.count (http://docs.python.org/dev/py3k/library/stdtypes.html)
documentation does not report that it returns the number of
*non-overlapping* instances. For example, I expected 'aaa'.count('aa')
to be 2 and not 1. Compare th
Matteo Dell'Amico added the comment:
Georg, you're right, there's a StopIteration to catch. My thinko was
mistaking the function for a generator where the exception propagation
would have done the right thing. The amended version now becomes
next(b)
for x, y in zip(a, b): yield
New submission from Matteo Dell'Amico :
I feel that the "pairwise" recipe could be slightly more elegant if "for
elem in b: break" became a simpler next(b) (or b.next() for Python 2.x).
It is also more natural to modify the recipes to suit one's needs (e.g.,
re
11 matches
Mail list logo