Hello All,
We're pleased to announce that the PyCon UK 2012 conference is open for
bookings at http://pyconuk.org. The Early Bird rate is available until 12
August, and there is a Concession rate available for Students, Nurses, and
Unwaged right up to the conference date.
PyCon UK runs from
On Tue, 10 Jul 2012 10:46:08 -0700, Subhabrata wrote:
Dear Group,
I kept a good number of files in a folder. Now I want to read all of
them. They are in different formats and different encoding. Using
listdir/glob.glob I am able to find the list but how to open/read or
process them for
funcs = [ lambda x: x**i for i in range( 5 ) ]
print funcs[0]( 2 )
print funcs[1]( 2 )
print funcs[2]( 2 )
This gives me
16
16
16
When I was excepting
1
2
4
Does anyone know why?
Cheers,
Daniel
--
Psss, psss, put it down! - http://www.cafepress.com/putitdown
--
funcs = [ lambda x: x**i for i in range( 5 ) ]
print funcs[0]( 2 )
print funcs[1]( 2 )
print funcs[2]( 2 )
This gives me
16
16
16
When I was excepting
1
2
4
Does anyone know why?
And more importantly, what's the simplest way to achieve the latter? :)
--
Psss, psss, put it
Hi.
funcs = [ lambda x: x**i for i in range( 5 ) ]
print funcs[0]( 2 )
This gives me
16
When I was excepting
1
Does anyone know why?
Just the way Python lambda expressions bind their variable
references. Inner 'i' references the outer scope's 'i' variable and not
its value 'at the
funcs = [ lambda x: x**i for i in range( 5 ) ]
print funcs[0]( 2 )
This gives me
16
When I was excepting
1
Does anyone know why?
Just the way Python lambda expressions bind their variable
references. Inner 'i' references the outer scope's 'i' variable and not
its value 'at the
On Tue, 2012-07-10 at 18:06 -0700, Rick Johnson wrote:
Also:
Q3: Why are you explicitly setting the name of your subFrame widgets
instead of allowing Tkinter to assign a unique name?...AND are you
aware of the conflicts that can arise from such changes[1]?
I find custom-named widgets
Greetings,
My name is Vojta and I am blind student. I am slowly learning Python for
about 4 years and I like it alot, mostly its ability to run on various
platforms.
My primary system is Ubuntu 12.04, but I have Windows XP at hand. I am
using python 2.7. I have learned basics from the book A byte
On 11/07/2012 2:41 AM, Daniel Fetchinson wrote:
funcs = [ lambda x: x**i for i in range( 5 ) ]
print funcs[0]( 2 )
print funcs[1]( 2 )
print funcs[2]( 2 )
This gives me
16
16
16
When I was excepting
1
2
4
Does anyone know why?
Cheers,
Daniel
I don't understand why you would expect 1, 2,
In article mailman.2011.1341994717.4697.python-l...@python.org,
Vojt®Ãch Pol®¢â°ek krec...@gmail.com wrote:
Then the menu module kicks in and should launch its
own loop checking for pygame keyboard events, but right after doing it
it prints:
[xcb] Unknown sequence number while
I've held off announcing this until I was sure it was really stable;
it's been 19 days since I made the last change to it, so here goes.
PollyReports is my Python module for report generation. It is designed
to be, quite literally, the simplest thing that can possibly work in
the field of PDF
I'm trying to combine python-code made with QT4 designer with plain
python statements like
file = open(test,w)
Can anyone tell me what I have to add to the following code just to
open a file when clicking on the load-button and closing it by
clicking on the save button.
#!/usr/bin/env python
#
On Wed, Jul 11, 2012 at 4:28 AM, Colin J. Williams c...@ncf.ca wrote:
I don't understand why you would expect 1, 2, 4.
Because:
funcs[0](2) == 2 ** 0 == 1
funcs[1](2) == 2 ** 1 == 2
funcs[2](2) == 2 ** 2 == 4
Perhaps parentheses will help the order of evaluation:
funcs = [(lambda x: x**i)
On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote:
Dear Group,
I kept a good number of files in a folder. Now I want to read all of
them. They are in different formats and different encoding. Using
listdir/glob.glob I am able to find the list but how to open/read or
process
Exactly. It's threads like these which remind me why I never use lambda. I
would rather give a function an explicit name and adhere to the familiar Python
syntax, despite the two extra lines of code. I don't even like the name
lambda. It doesn't tell you what it is (unless you're John
On 11 July 2012 19:15, subhabangal...@gmail.com wrote:
On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote:
Dear Group,
I kept a good number of files in a folder. Now I want to read all of
them. They are in different formats and different encoding. Using
listdir/glob.glob
On 11/07/12 20:38:18, woooee wrote:
You should not be using lambda in this case
.for x in [2, 3]:
.funcs = [x**ctr for ctr in range( 5 )]
.for p in range(5):
.print x, funcs[p]
.print
The list is called funcs because it is meant to contain functions.
Your code does not
On Wed, 11 Jul 2012 11:15:02 -0700, subhabangalore wrote:
On Tuesday, July 10, 2012 11:16:08 PM UTC+5:30, Subhabrata wrote:
Dear Group,
I kept a good number of files in a folder. Now I want to read all of
them. They are in different formats and different encoding. Using
listdir/glob.glob I
On Wed, 11 Jul 2012 11:38:18 -0700, woooee wrote:
You should not be using lambda in this case
.for x in [2, 3]:
.funcs = [x**ctr for ctr in range( 5 )]
.for p in range(5):
.print x, funcs[p]
.print
If you change the requirements, it's always easy to solve problems.
On 12/07/12 00:06, Chris Gonnerman wrote:
I've held off announcing this until I was sure it was really stable;
it's been 19 days since I made the last change to it, so here goes.
PollyReports is my Python module for report generation. It is designed
to be, quite literally, the simplest thing
On Wed, 11 Jul 2012 13:21:34 -0700, John Ladasky wrote:
Exactly. It's threads like these which remind me why I never use
lambda. I would rather give a function an explicit name and adhere to
the familiar Python syntax, despite the two extra lines of code.
lambda is familiar Python syntax,
On 11/07/12 17:37, Jean Dubois wrote:
I'm trying to combine python-code made with QT4 designer with plain
python statements like
file = open(test,w)
Can anyone tell me what I have to add to the following code just to
open a file when clicking on the load-button and closing it by
clicking on
Hi,
I'm working on a meta path hook that performs compilation of C extension
modules on import ( github.com/jwp/py-c ; pip install c ). It mostly works, but
I'm having a hard time finding a standard way to automatically install the hook
upon interpreter startup.
I've thought about just having
You should not be using lambda in this case
.for x in [2, 3]:
.funcs = [x**ctr for ctr in range( 5 )]
.for p in range(5):
.print x, funcs[p]
.print
If you change the requirements, it's always easy to solve problems. But
it is the wrong problem that you have solved.
The latest Zeus IDE Version 3.97o is now available:
http://www.zeusedit.com/python.html
This latest Zeus release adds improved Python debugger support.
Other Pyhon language features include syntax highlighting, code
completion, smart indenting, class browsing and code folding.
Zeus is also
On Thursday, July 12, 2012 12:34:33 AM UTC+8, Ian wrote:
On Wed, Jul 11, 2012 at 4:28 AM, Colin J. Williams lt;c...@ncf.cagt; wrote:
gt; I don#39;t understand why you would expect 1, 2, 4.
Because:
funcs[0](2) == 2 ** 0 == 1
funcs[1](2) == 2 ** 1 == 2
funcs[2](2) == 2 ** 2 == 4
gt;
On Wed, 11 Jul 2012 21:05:30 -0400, Dennis Lee Bieber wrote:
{non sequitur: I still recall my archaic C++ class with the OOAD
assignment of designing said calculator -- we never had to implement
one, just design the basic classes/methods/attributes [on 3x5 cards] for
a four-banger. I managed
On Wed, 11 Jul 2012 20:39:45 -0700, 8 Dihedral wrote:
I'll contribute my way of python programming:
def powerb(x, b): #
return x**b
Here's a shorter version:
py pow
built-in function pow
One functor is enough!
Nothing we have been discussing in this thread has been a functor,
On Wed, 11 Jul 2012 08:41:57 +0200, Daniel Fetchinson wrote:
funcs = [ lambda x: x**i for i in range( 5 ) ]
Here's another solution:
from functools import partial
funcs = [partial(lambda i, x: x**i, i) for i in range(5)]
Notice that the arguments i and x are defined in the opposite order.
On 7/11/2012 11:53 PM, Steven D'Aprano wrote:
On Wed, 11 Jul 2012 21:05:30 -0400, Dennis Lee Bieber wrote:
{non sequitur: I still recall my archaic C++ class with the OOAD
assignment of designing said calculator -- we never had to implement
one, just design the basic classes/methods/attributes
On Thursday, July 12, 2012 11:51:04 AM UTC+8, Steven D#39;Aprano wrote:
On Wed, 11 Jul 2012 20:39:45 -0700, 8 Dihedral wrote:
gt; I#39;ll contribute my way of python programming:
gt;
gt; def powerb(x, b): #
gt; return x**b
Here#39;s a shorter version:
pygt; pow
lt;built-in
On Wed, 11 Jul 2012 13:21:34 -0700 (PDT)
John Ladasky john_lada...@sbcglobal.net wrote:
Exactly. It's threads like these which remind me why I never use lambda. I
would rather give a function an explicit name and adhere to the familiar
Python syntax, despite the two extra lines of code. I
On Thu, 12 Jul 2012 10:41:52 +1000
Simon Cropper simoncrop...@fossworkflowguides.com wrote:
That said... with more than a passing interest in software and
content licensing I looked at how the work was licensed. A
none-standard license like this makes most people stop and think
will this be
Martin v. Löwis mar...@v.loewis.de added the comment:
I think the issue is grossly underspecified. The title of the issue is
sys.stdin is broken which says nothing about the way in which it is broken.
Taking Roger's literal description, and his msg165191, the complaint is that
input() no
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset b90482742ee0 by Martin v. Löwis in branch '3.2':
Issue #15319: Revert wrapping of sys.stdin. Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/b90482742ee0
--
nosy: +python-dev
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
Here is a patch that creates some unit tests for the existing getopt argument
parsing code.
In response to the comments, I'm thinking of a less invasive approach that
involves wrapping argparse's parse_args() to return getopt-like
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 42424c1f605c by Martin v. Löwis in branch '2.7':
Issue #15319: Revert wrapping of sys.stdin. Patch by Serhiy Storchaka.
http://hg.python.org/cpython/rev/42424c1f605c
--
Changes by Martin v. Löwis mar...@v.loewis.de:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15319
___
Martin v. Löwis mar...@v.loewis.de added the comment:
It's *clearly* not a duplicate. While #15319 is fixed, this issue remains - so
it can't possibly be a duplicate.
--
nosy: +loewis
resolution: duplicate -
superseder: IDLE - readline, isatty, and input broken -
Changes by Martin v. Löwis mar...@v.loewis.de:
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
___
Martin v. Löwis mar...@v.loewis.de added the comment:
I propose the attached patch to block write() calls.
--
keywords: +patch
Added file: http://bugs.python.org/file26350/blockwrite.diff
___
Python tracker rep...@bugs.python.org
Martin v. Löwis mar...@v.loewis.de added the comment:
Revised
--
Added file: http://bugs.python.org/file26351/blockwrite.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
There is indeed a race condition here. Fortunately unit tests take much more
time than the generator loop.
Is it enough to turn the generator into a fixed list? Or is the late binding
behavior of args_tuple important? (For example,
Mark Summerfield m...@qtrac.eu added the comment:
According to the Tcl/Tk docs the 'data' field is a string (i.e., for any user
data) and the 'detail' field contains some internal data (so shouldn't be
messed with); see http://www.tcl.tk/man/tcl8.5/TkCmd/event.htm#M16
Anyway, I hope you add a
New submission from Chris Jerdonek chris.jerdo...@gmail.com:
The long form of the -m/--match option does not work with regrtest because it
does not accept an argument. For example (observe the lack of an error in the
second invocation)--
$ ./python.exe -m test -m
option -m requires argument
Serhiy Storchaka storch...@gmail.com added the comment:
title: IDLE - input() is broken. - IDLE - sys.stdin is broken.
Well, now, with the modified header, I'm not going to open a separate
issue. Here is a patch that fixes almost all IDLE sys.std* issues.
--
title: IDLE - readline,
Martin v. Löwis mar...@v.loewis.de added the comment:
Serhiy: this issue is closed, so your patch won't be considered.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15319
___
Serhiy Storchaka storch...@gmail.com added the comment:
Sorry, I missed the morning's discussion.
--
title: IDLE - sys.stdin, sys.stdout, etc are broken - IDLE - readline, isatty,
and input broken
___
Python tracker rep...@bugs.python.org
Michael Foord mich...@voidspace.org.uk added the comment:
Looks good, thanks.
--
assignee: - michael.foord
nosy: +michael.foord
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15323
___
Serhiy Storchaka storch...@gmail.com added the comment:
sys.std* streams have many other issues.
sys.stdin.readable()
Traceback (most recent call last):
File pyshell#4, line 1, in module
sys.stdin.readable()
AttributeError: readable
sys.stdout.writable()
Traceback (most recent call
Serhiy Storchaka storch...@gmail.com added the comment:
Added getvar method to PyShell.console.
--
Added file: http://bugs.python.org/file26354/idle_stdstreams-3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
Martin v. Löwis mar...@v.loewis.de added the comment:
Serhiy: can you please explicitly list what issues your patch fixes?
I can think of many *more* issues that your patch doesn't fix, e.g.
sys.stdin.read(sys) and sys.stdout.read().
I'm quite opposed to monkey-patching, so I won't commit any
New submission from Chris Jerdonek chris.jerdo...@gmail.com:
The long form of the -f/--fromfile option does not work. It does not read its
required argument. For example (observe that the second invocation raises no
error)--
$ ./python.exe -m test -f
option -f requires argument
Use --help
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
Note that issue 15302 will fix this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15324
___
Martin v. Löwis mar...@v.loewis.de added the comment:
As an additional note: the change to monkey-patching breaks the test
isinstance(sys.stdout, io.TextIOBase)
which currently succeeds.
--
___
Python tracker rep...@bugs.python.org
New submission from Chris Jerdonek chris.jerdo...@gmail.com:
The long form of the -r/--random option does not work:
$ ./python.exe -m test --random
No handler for option --random. Please report this as a bug at
http://bugs.python.org.
Note that issue 15302 will fix this.
--
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
Attached is a first version of a complete patch.
Note that I found three bugs in the current argument parsing code in the course
of working on this patch: issue 15324, issue 15325, and issue 15326 (because of
various typos in the
New submission from Ingo Fischer fredistdurs...@googlemail.com:
I have an argument called '--verbose' in the main parser.
Then I add a subparser called 'command', to which I add an argument with the
same name '--verbose' (See attached script).
When I process these args, I cannot decide
Serhiy Storchaka storch...@gmail.com added the comment:
Serhiy: can you please explicitly list what issues your patch fixes?
issue12967. And sys.std* in IDLE lacks other common sys.std* methods and
attributes.
I can think of many *more* issues that your patch doesn't fix, e.g.
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
I don't think the late binding is necessary. But it looks like late binding
could be preserved simply by constructing args_tuple inside the worker thread
instead of in the generator. Really, only test needs to be yielded. Nothing
else
Serhiy Storchaka storch...@gmail.com added the comment:
As an additional note: the change to monkey-patching breaks the test
isinstance(sys.stdout, io.TextIOBase)
which currently succeeds.
Agree, this is a regression. However isinstance(sys.stdout,
io.TextIOBase) is False now in
André Cruz an...@cabine.org added the comment:
Attached is an updated patch against 2.7.3. It solves a bug in the tests and
implements Carl's suggestion. The new tests pass and it updates the
documentation as well.
As for inclusion in 2.7, as this is in fact solving a bug, I would vote for
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
I was about to say yes, listiter.__next__ is atomic (it should, really), but
that's not true (Hint: there is a Py_DECREF in the code...).
The script below crashes with:
Fatal Python error: Objects/listobject.c:2774 object at
O.C. oc-spa...@laposte.net added the comment:
I don't agree with this comment.
1) The 'detail' field also contains a string, one of the following:
NotifyAncestor, NotifyNonlinearVirtual,...
2) When an event is received, the 'detail' and 'user_data' fields are de facto
mixed up. Indeed, the
Changes by Brett Cannon br...@python.org:
--
stage: needs patch - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15302
___
___
Greg Roodt gro...@gmail.com added the comment:
By the way, the issue can be recreated by running the following:
netcat -l -p -e echo HTTP/1.1 1000 OK
python -c import urllib2; urllib2.urlopen('http://localhost:')
This happens on 2.6, 2.7 and 3 by the looks of it.
--
New submission from Lars Nordin lars.nor...@gmail.com:
The datetime.strptime works well enough for me it is just slow.
I recently added a comparison to a log parsing script to skip log lines earlier
than a set date. After doing so my script ran much slower.
I am processing 4,784,212 log lines
Lars Nordin lars.nor...@gmail.com added the comment:
Running the script without any timestamp comparison (and parsing more log
lines), gives these performance numbers:
log lines: 7,173,101
time output:
real1m9.892s
user0m53.563s
sys 0m1.592s
--
R. David Murray rdmur...@bitdance.com added the comment:
Thanks for the report. However, do you have a patch to propose? Otherwise I'm
not sure there is a reason to keep this issue open...one can always say various
things are slow; that by itself is not a bug. Performance enhancement
Serhiy Storchaka storch...@gmail.com added the comment:
issue9290 also has relation to this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Serhiy Storchaka storch...@gmail.com added the comment:
issue7163 is another PseudoFile-related issue.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Changes by florian-rathgeber florian.rathge...@gmail.com:
--
nosy: +florian-rathgeber
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7897
___
___
Changes by florian-rathgeber florian.rathge...@gmail.com:
--
nosy: +florian-rathgeber
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12600
___
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +eric.araujo, tarek
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15322
___
___
Antoine Pitrou pit...@free.fr added the comment:
Thanks, Chris. I haven't tested the patch but it looks fine.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15300
___
Éric Araujo mer...@netwok.org added the comment:
Looks like a duplicate; I can’t search right now (try sysconfig + build).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15322
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
nosy: +storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7163
___
___
Python-bugs-list
Antoine Pitrou pit...@free.fr added the comment:
Amaury's patch looks obviously fine.
As for the original issue: yes, I thought I saw a traceback once due to that.
Using list.pop() (or deque.pop()) instead would probably be good enough.
--
stage: - patch review
versions: +Python 2.7,
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15320
___
___
Python-bugs-list
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +flox
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14797
___
___
Python-bugs-list
rg3 sarbalap+freshm...@gmail.com added the comment:
I don't know if the behavior is considered a bug or just undocumented, but
under Python 2.7.3 it's still the same. locale.getpreferredencoding() does
return UTF-8, but the second element in the tuple locale.getdefaultlocale() is
Roundup Robot devn...@psf.upfronthosting.co.za added the comment:
New changeset 724a6e0e35f0 by Antoine Pitrou in branch '3.2':
Issue #15300: Ensure the temporary test working directories are in the same
parent folder when running tests in multiprocess mode from a Python build.
Antoine Pitrou pit...@free.fr added the comment:
Committed now.
--
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15300
Serhiy Storchaka storch...@gmail.com added the comment:
The patch is not work for ca_ES@valencia locale.
And there are issues for such locales: ks_in@devanagari,
ks...@devanagari.utf-8, sd, sd...@devanagari.utf-8 (ks_in@devanagari in
locale_alias maps to ks...@devanagari.utf-8 and sd to
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
I searched a little before. There is issue 12141,
sysconfig.get_config_vars('srcdir') fails in specific cases, but that issue
is closed.
In the comments there, Antoine seems to be describing the bug I describe here,
but I'm not sure
Martin v. Löwis mar...@v.loewis.de added the comment:
implements textio badly is *not* a well-defined issue.
First it is a personal judgement: some think it's really bad, some think it's
quite ok.
More importantly, such issue has no clear success criterion: how do we know we
are done - can
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
Attaching a patch for the original issue using deque.
--
Added file: http://bugs.python.org/file26359/issue-15320-1.patch
___
Python tracker rep...@bugs.python.org
Serhiy Storchaka storch...@gmail.com added the comment:
In any case,*this* issue is about sys.stdin being writable.
I already got confused with all these closing/reopening/renaming of
issues and floating code. Should I open my own issue even if it
duplicates and supersedes some other?
Any
Antoine Pitrou pit...@free.fr added the comment:
Hmm, actually the patch is not ok, because of the -F option which uses an
infinite iterator.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15320
jin j...@mediatomb.cc added the comment:
I just ran into exactly the same problem and was quite disappointed to see that
urlencode does not provide an option to use percent encoding.
My use case: I'm preparing some metadata on the server side that is stored as
an url encoded string, the
Changes by Martin v. Löwis mar...@v.loewis.de:
Added file: http://bugs.python.org/file26360/blockfile-3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Changes by Martin v. Löwis mar...@v.loewis.de:
Removed file: http://bugs.python.org/file26360/blockfile-3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Changes by Martin v. Löwis mar...@v.loewis.de:
Added file: http://bugs.python.org/file26361/blockfile-3.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15318
___
Martin v. Löwis mar...@v.loewis.de added the comment:
I already got confused with all these closing/reopening/renaming of
issues and floating code. Should I open my own issue even if it
duplicates and supersedes some other?
I personally think it would be best if these issues where closed
New submission from Chris Jerdonek chris.jerdo...@gmail.com:
I think it would help to clarify which collections.deque methods are
thread-safe:
http://docs.python.org/dev/library/collections.html?highlight=deque#collections.deque
Currently, the documentation says that Deques support
New submission from Chris Jerdonek chris.jerdo...@gmail.com:
It seems like it would be useful if collections.deque had a thread-safe method
that could rotate(1) and return the rotated value.
This would let deque to act as a thread-safe circular buffer (e.g. if serving
jobs to multiple threads
Roger Serwy roger.se...@gmail.com added the comment:
I tested blockfile-3.diff against the latest code in the repository.
sys.stdin.write returns the wrong error message when passed a non-string.
Presently it returns io.UnsupportedOperation instead of TypeError: must be str,
not ...
The
Chris Jerdonek chris.jerdo...@gmail.com added the comment:
Good catch. Here is a patch that takes --forever mode into account.
I wrote this patch with the assumption that it shouldn't hurt if multiple
threads call deque.extend() at the same time.
--
Added file:
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
assignee: - rhettinger
priority: normal - low
versions: +Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15330
___
Raymond Hettinger raymond.hettin...@gmail.com added the comment:
By thread-safe you mean that the operation should be atomic?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15330
___
1 - 100 of 103 matches
Mail list logo