On 18/09/12 16:02:02, Wanderer wrote:
On Monday, September 17, 2012 7:43:06 PM UTC-4, Martin De Kauwe wrote:
On Tuesday, September 18, 2012 8:31:09 AM UTC+10, Wanderer wrote:
I need to divide a 512x512 image array with the first horizontal
and vertical division 49 pixels in. Then every 59
בתאריך יום ראשון, 16 בספטמבר 2012 01:43:31 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 12 בספטמבר 2012 17:24:50 UTC+3, מאת Dan Katorza:
hello ,
i'm new to Python and i searched the web and could not find an answer for
my issue.
i need to get an ip
On 18/09/12 05:01:14, Ian Kelly wrote:
On Mon, Sep 17, 2012 at 7:08 PM, David Smith dav...@invtools.com wrote:
How do I indent if I have something like:
if (sR=='Cope'): sys.exit(1) elif (sR=='Perform') sys.exit(2) else
sys.exit(3)
How about:
if sR == 'Cope':
sys.exit(1)
elif sR ==
On Wed, Sep 19, 2012 at 5:41 PM, Dan Katorza dkato...@gmail.com wrote:
Hello again,
I have another question and i hope you will understand me..
Is there any option where you can set the program to go back to lets say the
top of the code?
I mean if the program finished the operation and i
בתאריך יום רביעי, 19 בספטמבר 2012 11:14:29 UTC+3, מאת Chris Angelico:
On Wed, Sep 19, 2012 at 5:41 PM, Dan Katorza dkato...@gmail.com wrote:
Hello again,
I have another question and i hope you will understand me..
Is there any option where you can set the program to go back to
On Wed, Sep 19, 2012 at 6:50 PM, Dan Katorza dkato...@gmail.com wrote:
i know about the while loop , but forgive me i just don't have a clue how to
use it for this situation.
You've already used one. What you need to do is surround your entire
code with the loop, so that as soon as it gets to
בתאריך יום רביעי, 19 בספטמבר 2012 11:50:56 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 11:14:29 UTC+3, מאת Chris Angelico:
On Wed, Sep 19, 2012 at 5:41 PM, Dan Katorza dkato...@gmail.com wrote:
Hello again,
I have another question and i hope you
Am 18.09.2012 15:03 schrieb David Smith:
I COULD break down each batch file and write dozens of mini python
scripts to be called. I already have a few, too. Efficiency? Speed is
bad, but these are bat files, after all. The cost of trying to work with
a multitude of small files is high, though,
One thing that is cooler with java-script than in python is that dictionaries
and objects are the same thing. It allows browsing of complex hierarchical data
syntactically easy.
For manipulating complex jsonable data, one will always prefer writing:
buildrequest.properties.myprop
rather than
2012/9/18 Dennis Lee Bieber wlfr...@ix.netcom.com:
Unless you have a really massive result set from that ls, that
command probably ran so fast that it is blocked waiting for someone to
read the PIPE.
I tried also with ls -lR / and that definitively takes a while to run,
when I do
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
--
http://mail.python.org/mailman/listinfo/python-list
Neal Becker wrote:
I have a list of dictionaries. They all have the same keys. I want to
find the set of keys where all the dictionaries have the same values.
Suggestions?
items = [
... {1:2, 2:2},
... {1:1, 2:2},
... ]
first = items[0].items()
[key for key, value in first if
Neal Becker writes:
I have a list of dictionaries. They all have the same keys. I want
to find the set of keys where all the dictionaries have the same
values. Suggestions?
Literally-ish:
{ key for key, val in ds[0].items() if all(val == d[key] for d in ds) }
--
On 09/19/2012 06:24 AM, Pierre Tardy wrote:
One thing that is cooler with java-script than in python is that dictionaries
and objects are the same thing. It allows browsing of complex hierarchical
data syntactically easy.
You probably need some different terminology, since a dictionary is
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
Here is my solution:
a = {}
a['dict'] = 1
b = {}
b['dict'] = 2
c = {}
c['dict'] = 1
d = {}
d['dict'] = 3
e = {}
e['dict'] = 1
x =
Dwight Hutto wrote:
I have a list of dictionaries. They all have the same keys. I want to
find the
set of keys where all the dictionaries have the same values.
Suggestions?
Here is my solution:
a = {}
a['dict'] = 1
b = {}
b['dict'] = 2
c = {}
c['dict'] = 1
d = {}
On 19-09-12 13:17, Neal Becker wrote:
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
common_items = reduce(opereator.__and__, [set(dct.iteritems()) for dct
in lst])
common_keys =
On 2012-09-19 05:22, Thomas Rachel wrote:
Am 18.09.2012 15:03 schrieb David Smith:
I COULD break down each batch file and write dozens of mini python
scripts to be called. I already have a few, too. Efficiency? Speed is
bad, but these are bat files, after all. The cost of trying to work with
a
On Wed, Sep 19, 2012 at 8:01 AM, Dwight Hutto dwightdhu...@gmail.com wrote:
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
This one is better:
a = {}
a['dict'] = 1
b = {}
b['dict']
בתאריך יום רביעי, 19 בספטמבר 2012 12:11:04 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 11:50:56 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 11:14:29 UTC+3, מאת Chris Angelico:
On Wed, Sep 19, 2012 at 5:41 PM, Dan Katorza dkato...@gmail.com wrote:
- Original Message -
Jean-Michel Pichavant jeanmic...@sequans.com writes:
- Original Message -
Jean-Michel Pichavant wrote:
[snip]
One minor note, the style of decorator you are using loses the
docstring
(at least) of the original function. I would add the
On 19/09/12 12:26:30, andrea crotti wrote:
2012/9/18 Dennis Lee Bieber wlfr...@ix.netcom.com:
Unless you have a really massive result set from that ls, that
command probably ran so fast that it is blocked waiting for someone to
read the PIPE.
I tried also with ls -lR / and that
On 2012-09-19, Dave Angel d...@davea.name wrote:
On 09/19/2012 06:24 AM, Pierre Tardy wrote:
All implementation I tried are much slower than a pure native dict access.
Each implementation have bench results in commit comment. All of them
are 20+x slower than plain dict!
Assuming you're
Am 19.09.2012 12:24 schrieb Pierre Tardy:
One thing that is cooler with java-script than in python is that dictionaries
and objects are the same thing. It allows browsing of complex hierarchical data
syntactically easy.
For manipulating complex jsonable data, one will always prefer writing:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I naively thought that sum('abc') would expand to 'a'+'b'+'c'
And the error message is somewhat
On Wed, Sep 19, 2012 at 10:41 AM, Franck Ditter fra...@ditter.org wrote:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I naively thought that
On 2012-09-19, Franck Ditter fra...@ditter.org wrote:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I naively thought that sum('abc') would
On Wed, Sep 19, 2012 at 8:41 AM, Franck Ditter fra...@ditter.org wrote:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I naively thought that
On 2012-09-19, Ian Kelly ian.g.ke...@gmail.com wrote:
It notes in the doc string that it does not work on strings:
sum(...)
sum(sequence[, start]) - value
Returns the sum of a sequence of numbers (NOT strings) plus
the value of parameter 'start' (which defaults to 0). When
On Wed, 19 Sep 2012 16:41:20 +0200, Franck Ditter wrote:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I naively thought that sum('abc')
On Wed, Sep 19, 2012 at 6:13 AM, Antoon Pardon
antoon.par...@rece.vub.ac.be wrote:
On 19-09-12 13:17, Neal Becker wrote:
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
common_items =
On Wed, Sep 19, 2012 at 9:06 AM, Neil Cerutti ne...@norwich.edu wrote:
Are iterables and sequences different enough to warrant posting a
bug report?
The glossary is specific about the definitions of both, so I would say yes.
http://docs.python.org/dev/glossary.html#term-iterable
On Sep 19, 8:06 am, Neil Cerutti ne...@norwich.edu wrote:
On 2012-09-19, Ian Kelly ian.g.ke...@gmail.com wrote:
It notes in the doc string that it does not work on strings:
sum(...)
sum(sequence[, start]) - value
Returns the sum of a sequence of numbers (NOT strings) plus
On Wednesday 19 September 2012 11:56:44 Hans Mulder did opine:
On 19/09/12 12:26:30, andrea crotti wrote:
2012/9/18 Dennis Lee Bieber wlfr...@ix.netcom.com:
Unless you have a really massive result set from that ls,
that
command probably ran so fast that it is blocked
On Wed, 19 Sep 2012 09:03:03 -0600, Ian Kelly wrote:
I think this restriction is mainly for efficiency. sum(['a', 'b', 'c',
'd', 'e']) would be the equivalent of 'a' + 'b' + 'c' + 'd' + 'e', which
is an inefficient way to add together strings.
It might not be obvious to some people why
This has been proposed and discussed and even implemented many
times on this list and others.
I can find this question on SO
http://stackoverflow.com/questions/4984647/accessing-dict-keys-like-an-attribute-in-python
which is basically answered with this solution
class AttributeDict(dict):
On Wed, 19 Sep 2012 15:07:04 +, Alister wrote:
Summation is a mathematical function that works on numbers Concatenation
is the process of appending 1 string to another
although they are not related to each other they do share the same
operator(+) which is the cause of confusion.
2012/9/19 Hans Mulder han...@xs4all.nl:
Yes: using top is an observation problem.
Top, as the name suggests, shows only the most active processes.
Sure but ls -lR / is a very active process if you try to run it..
Anyway as written below I don't need this anymore.
It's quite possible that
2012/9/19 Trent Nelson tr...@snakebite.org:
FWIW, I gave a presentation on decorators to the New York Python
User Group back in 2008. Relevant blog post:
http://blogs.onresolve.com/?p=48
There's a link to the PowerPoint presentation I used in the first
paragraph.
On Sep 19, 2012 9:37 AM, andrea crotti andrea.crott...@gmail.com wrote:
Well there is a process which has to do two things, monitor
periodically some external conditions (filesystem / db), and launch a
process that can take very long time.
So I can't put a wait anywhere, or I'll stop
Neal Becker ndbeck...@gmail.com writes:
I have a list of dictionaries. They all have the same keys. I want to find
the
set of keys where all the dictionaries have the same values. Suggestions?
Untested, and uses a few more comparisons than necessary:
# ds = [dict1, dict2 ... ]
d0 =
Hello list
From man 2 EXECVE
By default, file descriptors remain open across an execve()
And from man 2 FCNTL
Record locks are... preserved across an execve(2).
So the question:
* If I execve a python script (from C), how can I retrieve the list of
files, and optionally the list of locks, from
On 19/09/12 18:34:58, andrea crotti wrote:
2012/9/19 Hans Mulder han...@xs4all.nl:
Yes: using top is an observation problem.
Top, as the name suggests, shows only the most active processes.
Sure but ls -lR / is a very active process if you try to run it..
Not necessarily:
It's quite
On Tue, 2012-09-18 at 22:12 -0600, Jason Friedman wrote:
I'm converting windows bat files little by little to Python 3 as I find time
and learn Python.
The most efficient method for some lines is to call Python like:
python -c import sys; sys.exit(3)
How do I indent if I have something
On 9/19/2012 8:27 AM, David Smith wrote:
but not:
print('hi');if 1: print('hi')
Chokes on the 'if'. On the surface, this is not consistent.
Yes it is. ; can only be followed by simple statements. The keyword for
compound statememts must be the first non-indent token on a line. That
is why
On 09/19/2012 08:28 AM, Dan Katorza wrote:
בתאריך יום רביעי, 19 בספטמבר 2012 12:11:04 UTC+3, מאת Dan Katorza:
SNIP
hi, ll like
found a solution,
it's not quite like Chris advised but it works.
Not at all like Chris advised. But it also doesn't help you understand
programming. Two concepts
On 19/09/12 19:51:44, Albert Hopkins wrote:
On Tue, 2012-09-18 at 22:12 -0600, Jason Friedman wrote:
I'm converting windows bat files little by little to Python 3 as I find time
and learn Python.
The most efficient method for some lines is to call Python like:
python -c import sys;
Hello all:
This is my first shot with UWSGI and Python on Nginx, and I'm getting
kind of confused.
My uwsgi init script looks like:
#!/bin/sh
#/etc/init.d/uwsgi
### BEGIN INIT INFO
# Provides: uwsgi
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
###
On Wed, Sep 19, 2012 at 9:37 AM, Steve Howell showel...@yahoo.com wrote:
Sequences are iterables, so I'd say the docs are technically correct,
but maybe I'm misunderstanding what you would be trying to clarify.
The doc string suggests that the argument to sum() must be a sequence,
when in fact
On Sep 19, 11:34 am, Ian Kelly ian.g.ke...@gmail.com wrote:
On Wed, Sep 19, 2012 at 9:37 AM, Steve Howell showel...@yahoo.com wrote:
Sequences are iterables, so I'd say the docs are technically correct,
but maybe I'm misunderstanding what you would be trying to clarify.
The doc string
On 9/19/2012 11:07 AM, Alister wrote:
Summation is a mathematical function that works on numbers
Concatenation is the process of appending 1 string to another
although they are not related to each other they do share the same
operator(+) which is the cause of confusion.
If one represents
Folks,
I asked the same query on the python tutor mailing list.
The responses i received are here :
http://thread.gmane.org/gmane.comp.python.tutor/77601
Mark,
There is nothing wrong in asking a query on multiple forums.
Poeple on the tutor list, may not be part of comp.lang.python
andrea crotti於 2012年9月20日星期四UTC+8上午12時42分50秒寫道:
2012/9/19 Trent Nelson tr...@snakebite.org:
FWIW, I gave a presentation on decorators to the New York Python
User Group back in 2008. Relevant blog post:
http://blogs.onresolve.com/?p=48
There's a
Hi PyTutor Folks
Here is my situation
1. I have two machines. Lets call them local remote.
Both run ubuntu both have python installed
2. I have a python script, local.py, running on local which needs to pass
arguments ( 3/4 string arguments, containing whitespaces like spaces, etc ) to
a
Hi c.l.p folks
Here is my situation
1. I have two machines. Lets call them 'local' 'remote'.
Both run ubuntu both have python installed
2. I have a python script, local.py, running on 'local' which needs to pass
arguments ( 3/4 string arguments, containing whitespaces like spaces, etc ) to
On 2012-09-19 14:18, Terry Reedy wrote:
stating correctly that it works for exec().
My mistake. I fancied you were talking shell, not python. I now see that
Python 3 has exec() as a built-in.
python -c exec('print(\hi\)\nif 0:\n print(\hi\)\nelif 1:\n
print(\hi2\)')
worked right off the
2012/9/19 ashish ashish.mak...@gmail.com:
Hi c.l.p folks
Here is my situation
1. I have two machines. Lets call them 'local' 'remote'.
Both run ubuntu both have python installed
2. I have a python script, local.py, running on 'local' which needs to pass
arguments ( 3/4 string
2012/9/19 Ismael Farfán sulfur...@gmail.com:
Hello list
From man 2 EXECVE
By default, file descriptors remain open across an execve()
And from man 2 FCNTL
Record locks are... preserved across an execve(2).
So the question:
* If I execve a python script (from C), how can I retrieve the
On Wed, Sep 19, 2012 at 11:34 AM, Ismael Farfán sulfur...@gmail.com wrote:
So the question:
* If I execve a python script (from C), how can I retrieve the list of
files, and optionally the list of locks, from within the execve(d)
python process so that I can use them?
Some more info:
I'm
On Wed, Sep 19, 2012 at 2:36 PM, Ismael Farfán sulfur...@gmail.com wrote:
It seems like I can use os.fstat to find out if a fd exists and also
get it's type and mode (I'm getting some pipes too : )
Sure, because files and pipes both use the file descriptor
abstraction. If your process does any
2012/9/19 Ian Kelly ian.g.ke...@gmail.com:
On Wed, Sep 19, 2012 at 2:36 PM, Ismael Farfán sulfur...@gmail.com wrote:
It seems like I can use os.fstat to find out if a fd exists and also
get it's type and mode (I'm getting some pipes too : )
Sure, because files and pipes both use the file
On 19/09/12 17:07:04, Alister wrote:
On Wed, 19 Sep 2012 16:41:20 +0200, Franck Ditter wrote:
Hello,
I wonder why sum does not work on the string sequence in Python 3 :
sum((8,5,9,3))
25
sum([5,8,3,9,2])
27
sum('rtarze')
TypeError: unsupported operand type(s) for +: 'int' and 'str'
I
On 2012-09-19, Pierre Tardy tar...@gmail.com wrote:
--===1362296571==
Content-Type: multipart/alternative; boundary=bcaec554d3229e814204ca105e50
--bcaec554d3229e814204ca105e50
Content-Type: text/plain; charset=ISO-8859-1
This has been proposed and discussed and even
Am 19.09.2012 19:34, schrieb Ismael Farfán:
Hello list
From man 2 EXECVE
By default, file descriptors remain open across an execve()
And from man 2 FCNTL
Record locks are... preserved across an execve(2).
So the question:
* If I execve a python script (from C), how can I retrieve the
Does anyone know how to install Pip onto a mac os x ver 10.7.4?
Ive tried easy_instal pip but it brings up this message (but it doesn't help
with my problem):
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
On Sep 19, 2012 6:37 PM, John Mordecai Dildy jdild...@gmail.com wrote:
Does anyone know how to install Pip onto a mac os x ver 10.7.4?
Ive tried easy_instal pip but it brings up this message (but it doesn't
help with my problem):
error: can't create or remove files in install directory
The
On Thu, Sep 20, 2012 at 7:09 AM, Ian Kelly ian.g.ke...@gmail.com wrote:
You could do:
os.listdir(/proc/%d/fd % os.getpid())
This should work on Linux, AIX, and Solaris, but obviously not on Windows.
I'm not sure how cross-platform it is, but at least on Linux, you can
use /proc/self as an
Ask the user for the amount of change expressed in cents. Your program must
compute and display the number of half-dollars, quarters, dimes, nickels,
and pennies to be returned.
Return as many half-dollars as possible, then quarters, dimes, nickels, and
pennies, in that order.
Your program
ashish ashish.mak...@gmail.com wrote:
Here is my situation
1. I have two machines. Lets call them 'local' 'remote'.
Both run ubuntu both have python installed
2. I have a python script, local.py, running on 'local' which needs to pass
arguments ( 3/4 string arguments, containing whitespaces
2012/9/19 Christian Heimes christ...@python.org:
So the question:
* If I execve a python script (from C), how can I retrieve the list of
files, and optionally the list of locks, from within the execve(d)
python process so that I can use them?
Have a look at psutil:
On Wed, 19 Sep 2012 12:46:33 -0700, ashish wrote:
Hi PyTutor Folks
Here is my situation
1. I have two machines. Lets call them local remote. Both run ubuntu
both have python installed
2. I have a python script, local.py, running on local which needs to
pass arguments ( 3/4 string
On Thu, Sep 20, 2012 at 2:27 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Wed, 19 Sep 2012 12:46:33 -0700, ashish wrote:
2. I have a python script, local.py, running on local which needs to
pass arguments ( 3/4 string arguments, containing whitespaces like
spaces, etc )
בתאריך יום רביעי, 19 בספטמבר 2012 15:28:23 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 12:11:04 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 11:50:56 UTC+3, מאת Dan Katorza:
בתאריך יום רביעי, 19 בספטמבר 2012 11:14:29 UTC+3, מאת Chris Angelico:
Ronald Oussoren added the comment:
The workaround should not be implemented in os.read because it is a very thin
wrapper around the system call and should stay that way.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15896
Chris Jerdonek added the comment:
Personally I think the best solution is to have the test framework allocate a
single test directory
This is partially done. See here:
http://hg.python.org/cpython/file/19c74cadea95/Lib/test/regrtest.py#l1810
# Run the tests in a context manager that
Vitaly added the comment:
The workaround should not be implemented in os.read because it is a very thin
wrapper around the system call and should stay that way.
Although this issue was initially filed as Sporadic EINVAL in nonblocking pipe
os.read when forked child fails on Mac OS, the
Ronald Oussoren added the comment:
How can you work around it in os.read, without knowing anything about what the
file descriptor represents? Just triggering on getting on EINVAL error when
calling read might trigger other problems and might even be a valid result for
some file descriptors
Serhiy Storchaka added the comment:
+.. function:: int(number=0)
First argument is named x.
int(number=42)
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: 'number' is an invalid keyword argument for this function
int(x=42)
42
+ int(string,
Ezio Melotti added the comment:
I seem to remember writing code that fished the wrapped error
out using one of those attributrs...
That would be err.reason:
from urllib.request import urlopen
try:
urlopen('http://www.pythonfoobarbaz.org')
except Exception as exc:
print('err:', err)
Changes by Chris Jerdonek chris.jerdo...@gmail.com:
--
nosy: +cjerdonek
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6471
___
___
Ezio Melotti added the comment:
First argument is named x.
Sometimes the doc uses better names to improve clarity when the argument is
not supposed to be called as keyword arg.
Here can be not only string, but bytes or bytearray.
The same applies here. string is also used in the error
Serhiy Storchaka added the comment:
If I change the regex to _has_surrogates =
re.compile('[\udc80-\udcff]').search, the tests still pass but there's no
improvement on startup time (note: the previous regex was matching all the
surrogates in this range too, however I'm not sure how well
Ezio Melotti added the comment:
What about _has_surrogates = re.compile('[^\udc80-\udcff]*\Z').match ?
The runtime is a bit slower than re.compile('[\udc80-\udcff]').search, but
otherwise it's faster than all the other alternatives. I haven't checked the
startup-time, but I suspect it won't
Serhiy Storchaka added the comment:
I haven't checked the startup-time, but I suspect it won't be better -- maybe
even worse.
I suppose it will be much better.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11454
Serhiy Storchaka added the comment:
Startup-time:
$ ./python -m timeit -s 'import re'
're.compile(([^\ud800-\udbff]|\A)[\udc00-\udfff]([^\udc00-\udfff]|\Z)).search;
re.purge()'
100 loops, best of 3: 4.16 msec per loop
$ ./python -m timeit -s 'import re' 're.purge()'
Michael Foord added the comment:
It maybe that patch.object is a more natural interface to the small sample of
people commenting here, in which case great - that's what it's there for.
However in common usage patch is used around two orders of magnitude more. I've
seen large codebases with
Martin v. Löwis added the comment:
I think it should be possible to add a wait=False parameter to rmtree which
makes it block until the directory is gone away. This could be similar to the
test.support feature added in #15496.
For compatibility, such a flag should default to False, and users
Serhiy Storchaka added the comment:
Faster set-version:
$ ./python -m timeit -s 'h=lambda s, hn=set(map(chr, range(0xDC80,
0xDD00))).isdisjoint: not hn(s); s = A*1000' 'h(s)'
1 loops, best of 3: 43.8 usec per loop
--
___
Python tracker
Martin v. Löwis added the comment:
What do you think?
[Even though I wasn't asked]
I think we may need to close the issue as won't fix. Depending on the
exact change propsosed, it may be that the return type for existing
operations might change, which shouldn't be done in a bug fix release.
Martin v. Löwis added the comment:
The case that python is a Python 3 binary is not a supported installation
(see PEP 394). asdl_c.py works on both 2.x and 3.x unmodified in the 3.x
branch, however, backporting this to 2.7 would be a new feature (support for
building on systems where python
Mark Dickinson added the comment:
Ah, I added the wrong Brian to the nosy. Sorry, Brian C.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15966
___
STINNER Victor added the comment:
Code of the failing test:
import faulthandler
import time
def func(timeout, repeat, cancel, file, loops):
for loop in range(loops):
faulthandler.dump_tracebacks_later(timeout, repeat=repeat, file=file)
if cancel:
R. David Murray added the comment:
Ah, of course. I should have reread the whole issue :)
The backward compatibility is the big concern here. Regardless of what we do
about that, we should at least fix this in 3.4.
--
___
Python tracker
Changes by Brett Cannon br...@python.org:
--
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15415
___
___
Python-bugs-list
Éric Araujo added the comment:
A data point: at work I follow Pyramid testing guidelines which tell you not to
import code under test at module level, but in your test functions, so that if
you have an error your tests do start and you see the error under the test
method. This means that I
New submission from John Taylor:
import os.path
a = [ r'c:\Windows\notepad.exe' ]
print( os.path.getsize(a) )
Under Python 3.2.3, this error message is returned:
File c:\python32\lib\genericpath.py, line 49, in getsize
return os.stat(filename).st_size
TypeError: Can't convert 'list'
Christian Heimes added the comment:
Linux:
os.stat([])
Traceback (most recent call last):
File stdin, line 1, in module
FileNotFoundError: [Errno 2] No such file or directory: ''
[60996 refs]
os.stat([None])
Traceback (most recent call last):
File stdin, line 1, in module
TypeError: an
Chris Jerdonek added the comment:
The case that python is a Python 3 binary is not a supported installation
Just to clarify, in the original scenario, python did not refer to anything.
From the original comment:
$ python
No such file or directory
(python2 and python3 did refer to the
Christian Heimes added the comment:
$ make touch
make: *** No rule to make target `touch'. Stop.
Martin meant:
touch Include/Python-ast.h Python/Python-ast.c
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15964
Chris Jerdonek added the comment:
Yes, that works. Rather than closing this as won't fix, however, I would
suggest that we document the workaround in the devguide.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15964
1 - 100 of 175 matches
Mail list logo