New submission from Lars Buitinck :
I've found some counterintuitive behavior in collections.Counter while hacking
on the scikit-learn project [1]. I wanted to use a bunch of Counters to do some
simple term counting in a set of documents, roughly as follows:
count_total = Counter()
Lars Buitinck added the comment:
If this is not implemented because it is backwards incompat, then it might be
useful to add a note to update's docstring explaining that it is much more
efficient than +=. I was very surprised that it took *minutes* to add a few
thousand moderate-
Changes by Lars Buitinck :
--
title: Allow multiple calls to multiprocessing.set_start_method -> Robustness
issues in multiprocessing.{get,set}_start_method
___
Python tracker
<http://bugs.python.org/issu
New submission from Lars Buitinck:
The new multiprocessing based on forkserver (issue8713) looks great, but it has
two problems. The first:
"set_start_method() should not be used more than once in the program."
The documentation does not explain what the effect of calling it twice
Changes by Lars Buitinck :
--
nosy: +sbt
___
Python tracker
<http://bugs.python.org/issue18999>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Lars Buitinck :
Removed file: http://bugs.python.org/file31721/mp_getset_start_method.patch
___
Python tracker
<http://bugs.python.org/issue18999>
___
___
Pytho
Lars Buitinck added the comment:
Cleaned up the patch.
--
Added file: http://bugs.python.org/file31722/mp_getset_start_method.patch
___
Python tracker
<http://bugs.python.org/issue18
Lars Buitinck added the comment:
In my patched version, the private popen.get_start_method gets a kwarg
set_if_needed=True. popen.Popen calls that as before, so its behavior should
not change, while the public get_start_method sets the kwarg to False.
I realise now that this has the side
Changes by Lars Buitinck :
--
nosy: +jnoller
___
Python tracker
<http://bugs.python.org/issue18999>
___
___
Python-bugs-list mailing list
Unsubscribe:
Lars Buitinck added the comment:
I don't really see the benefit of a context manager over an argument. It's a
power user feature anyway, and context managers (at least to me) signal cleanup
actions, rather than construction options.
--
New submission from Lars Buitinck :
The section "Inplace Operators" of the module docs for operator now show up in
TOC at http://docs.python.org/dev/library/. I don't think that's intended as it
does not describe a separate module.
--
assignee: docs@python
compo
New submission from Lars Buitinck:
I spotted a minor typo in the "What's new" for Py 3.3, introduced yesterday.
See attached patch.
--
assignee: docs@python
components: Documentation
files: typo.hg
messages: 171333
nosy: docs@python, larsmans
priority: normal
severity
Lars Buitinck added the comment:
Sorry about the bundle, I'm an hg noob and only noticed that bundles are binary
after I submitted it. Will create a regular patch next time.
--
___
Python tracker
<http://bugs.python.org/is
Lars Buitinck added the comment:
Any reason why this issue is still open? I just got a lot of compiler warnings
when building Numpy, so this isn't just relevant to C++ programmers.
(Btw., I did RTFM: the issue's Resolution is "accepted" but that option is not
documente
Lars Buitinck added the comment:
Redid the patch.
--
Added file: http://bugs.python.org/file28653/constness.patch
___
Python tracker
<http://bugs.python.org/issue9
Lars Buitinck added the comment:
Oops, forgot to save changes to Doc/c-api/object.rst.
PyObject_CallMethodObjArgs takes a PyObject*, mustn't that be non-const for
reference counting to work?
PyDict_GetItemString already has const, just not in refcounts.dat. Fixed.
--
Added file:
Lars Buitinck added the comment:
Ok. Do you (or jnoller?) have time to review my proposed patch, at least before
3.4 is released? I didn't see it in the release schedule, so it's probably not
planned soon, but I wouldn't want the API to change
Lars Buitinck added the comment:
> BTW, the context objects are singletons.
I haven't read all of your patch yet, but does this mean a forkserver will be
started regardless of whether it is later used?
That would be a good thing, since starting the fork server after reading in
la
Lars Buitinck added the comment:
Ok, great.
--
___
Python tracker
<http://bugs.python.org/issue18999>
___
___
Python-bugs-list mailing list
Unsubscribe:
Lars Buitinck added the comment:
Thanks, much better than my solution!
--
status: pending -> open
___
Python tracker
<http://bugs.python.org/issue18999>
___
_
Lars Buitinck added the comment:
Strange, I can't actually get it to work:
>>> from multiprocessing import Pool, get_context
>>> forkserver = get_context('forkserver')
>>> Pool(context=forkserver)
Traceback (most recent call last):
File "&qu
Lars Buitinck added the comment:
I also tried
from multiprocessing.pool import Pool
but that died with
ImportError: cannot import name get_context
--
___
Python tracker
<http://bugs.python.org/issue18
New submission from Lars Buitinck:
The declaration for PyErr_WarnEx in Doc/c-api/exceptions.rst is missing a const
compared to Include/warnings.h.
--
assignee: docs@python
components: Documentation
files: pyerr_warnex_const.patch
keywords: patch
messages: 228657
nosy: docs@python
Lars Buitinck added the comment:
I'm sorry, I really don't understand this refcounts.dat file and I'm not going
to hack it further. Does the patch as it currently stands solve the issue with
CallMethod and CallFunction, or not? (It has the chan
New submission from Lars Buitinck:
PySequence_List has accepted iterables since changeset 6c82277e77f3 of May 1,
2001 ("NEEDS DOC CHANGES" :), but its documentation still only speaks of
sequences. I suggest that it is changed to promise to handle arbitrary
iterables,
25 matches
Mail list logo