Douman added the comment:
Just to up issue.
It seems that there is some changes in 2.7.9 that breaks usage of
urllib2.urlopen()
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23245
___
Serhiy Storchaka added the comment:
Unless we use recent PyPy with ordered dicts.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23493
___
___
STINNER Victor added the comment:
Oh, forget my comment. sorted() never changes the input list, so the
microbenchmark is ok.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23493
___
On 2015-02-22, Dave Farrance davefarra...@omitthisyahooandthis.co.uk wrote:
It's still quicker to do a re-write in the more cumbersome C
You should try Cython.
Dave
--
https://mail.python.org/mailman/listinfo/python-list
Serhiy Storchaka added the comment:
My interpretation of the results. In CPython using operator.itemgetter() makes
sorting up to 2 times faster (only 25% faster with string keys), in PyPy it
make sorting slightly slower (because operator.itemgetter() is implemented in
Python, but the lambda
Serhiy Storchaka added the comment:
CPython:
$ python3.4 -m timeit -s 'f = lambda kv: kv[0]' -s 's =
list(dict.fromkeys(range(1000)).items())' -- 'sorted(s, key=f)'
1000 loops, best of 3: 904 usec per loop
$ python3.4 -m timeit -s 'import operator' -s 'f = operator.itemgetter(0)' -s
's =
STINNER Victor added the comment:
If I remember correctly, the complexity and performance of sort/sorted depends
if the data set is sorted or not. You may recreated the list/dictionary at each
iteration to get performances closer to items = sorted(dct.items(), key=lambda
kv: kv[0]) (dict keys
STINNER Victor added the comment:
That said, it is applied only n-times and is likely insignificant when
compared to the O(n log n) sort. (...)
904 usec = 462 usec is very significant: it's 49% faster. So I'm ok for the
change.
Note: PyPy JIT may not be able to optimize
STINNER Victor added the comment:
My interpretation of the results. In CPython using operator.itemgetter() makes
sorting up to 2 times faster
If I remember correctly, Python functions implemented in C don't create a
Python frame. The Python frame is an important cost in term of performances.
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
Changes by Serhiy Storchaka storch...@gmail.com:
--
status: languishing - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23493
___
___
pfranke...@gmail.com:
Hello Marko!
Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa:
In asyncio, you typically ignore the value returned by yield. While
generators use yield to communicate results to the calling program,
coroutines use yield only as a trick to implement
Cem Karan wrote:
On Feb 21, 2015, at 12:27 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
The simplest possible identity-based scheme would be something like this:
# don't hate me for using a global variable
CALLBACKS = []
def register(func):
if func not in
ast nom...@invalid.com:
Is there a way to define a container object able to store some
variables so that a change of a variable make a change in this object
content ?
I dont need this feature. It is just something I am thinking about.
In C language, there is A for address of A
In Python,
Dave Cook davec...@nowhere.net wrote:
On 2015-02-22, Dave Farrance davefarra...@omitthisyahooandthis.co.uk wrote:
It's still quicker to do a re-write in the more cumbersome C
You should try Cython.
I did try Cython when I was trying to figure out what to do about the slow
speed. My initial
When `shell=True`, the first argument should be string passed to shell.
So you should:
proc1=subprocess.Popen(/root/Desktop/abc.py 64 abc,
shell=True,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
On Mon, Feb 23, 2015 at 9:13 PM, Robert Clove cloverob...@gmail.com wrote:
Hi All,
I am
On 23/02/2015 13:13, Robert Clove wrote:
Hi All,
I am using the Linux system with python, i am running the following script
#!/usr/bin/python
import threading
import time
import sys
import subprocess
import datetime
import os
import time
import logging
hi
a = 2; b = 5
Li = [a, b]
Li
[2, 5]
a=3
Li
[2, 5]
Ok, a change in a or b doesn't impact Li. This works as expected
Is there a way to define a container object able to store some variables
so that a change of a variable make a change in this object content ?
I dont need this
Cem Karan cfkar...@gmail.com wrote in message
news:a3c11a70-5846-4915-bb26-b23793b65...@gmail.com...
Good questions! That was why I was asking about 'gotchas' with WeakSets
originally. Honestly, the only way to know for sure would be to write two
APIs for doing similar things, and then
Hi
I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh
session. Python is running on Centos 5.
Currently, the arrow keys do not work:
$ /usr/local/bin/python3.4
Python 3.4.2 (default, Feb 11 2015, 15:06:33)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] on linux
Type help,
On 2015-02-23 13:44, David Aldrich wrote:
I want to use the Python 3.4 interpreter interactively, via a PuTTY
ssh session. Python is running on Centos 5.
Currently, the arrow keys do not work:
[snip]
sudo apt-get install libreadline-dev
followed by a rebuild of Python
or
pip
STINNER Victor added the comment:
23314_tf_inherit_check.diff: I would prefer to see this complex code in a
function of the support module. For example, the SuppressCrashReport class is a
good candidate.
--
___
Python tracker rep...@bugs.python.org
On Feb 22, 2015, at 5:29 PM, Laura Creighton l...@openend.se wrote:
In a message of Sun, 22 Feb 2015 17:09:01 -0500, Cem Karan writes:
Documentation is a given; it MUST be there. That said, documenting
something, but still making it surprising, is a bad idea. For
example, several people
Serhiy Storchaka added the comment:
Could you measure the effect on json.encode()?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23493
___
___
On 02/23/2015 07:55 AM, ast wrote:
hi
a = 2; b = 5
Li = [a, b]
Li
[2, 5]
a=3
Li
[2, 5]
Ok, a change in a or b doesn't impact Li. This works as expected
Is there a way to define a container object able to store some variables
so that a change of a variable make a change in this object
Hi,
I am deploying Python to hundreds of machines using SCCM 2012. I am using the
below command to install:
Msiexec /i python.msi TARGETDIR=C:\Program Files\Python ALLUSERS=1 /qn
Even though I am using /qn, a command prompt still appears at the end of the
install for about 5-6 seconds. Is
On Mon, Feb 23, 2015 at 11:13 PM, Robert Clove cloverob...@gmail.com wrote:
proc1=subprocess.Popen(/root/Desktop/abc.py,64,abc,shell=True,stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
As others have said, you need to use either a single command or a list
of strings. But why are you using
Cyd Haselton added the comment:
The attached g-zipped file contains the first set of patches required to build
Python 3.4.2 from source in the environment specified in the origonal post.
Will post the second/final set ASAP
--
Added file:
STINNER Victor added the comment:
It's not convinient to have patches in a tarball. Please at least open patches
one by one, or better: open one issue per patch. You should group similar
changes in a single patch: for example all changes related to wcstombs().
You should explain each change.
Wouter Bolsterlee added the comment:
Using IPython and CPython 3.4:
d = dict.fromkeys(map(str, range(1000)))
Current implementation:
%timeit sorted(d.items(), key=lambda kv: kv[0])
1000 loops, best of 3: 605 µs per loop
%timeit sorted(d.items(), key=lambda kv: kv[0])
1000 loops, best of
On Sunday, 22 February 2015 14:11:54 UTC, Mark Lawrence wrote:
On 19/02/2015 16:27, Phillip Fleming wrote:
In my opinion, Python will not take off like C/C++ if there is no ANSI
standard.
Python has already taken off because it doesn't have a standard as such.
Bjarne Stroustrup, in
Marc Schlaich added the comment:
Please fix this. Scripts with multiprocessing bundled as wheels are broken with
Python 2.7 on Windows: https://github.com/pypa/pip/issues/1891
--
nosy: +schlamar
___
Python tracker rep...@bugs.python.org
Laura Creighton l...@openend.se wrote:
Good news -- it seems to be working fine with PyPy.
https://travis-ci.org/hugovk/Pillow/builds
for me, not extensively tested, it just seems to be working.
I have several pypy's floating around here, each within its own
virtualenv. If you aren't familiar
On Tue, Feb 24, 2015 at 12:44 AM, David Aldrich
david.aldr...@emea.nec.com wrote:
I want to use the Python 3.4 interpreter interactively, via a PuTTY ssh
session. Python is running on Centos 5.
This stackoverflow thread:
Hi, the parameter list should be a list of strings, not several unpacked
strings :
command = [/root/Desktop/abc.py,64,abc]
proc1 = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
The first argument is list of string only when `shell=False`
On 23/02/2015 13:57, Colin Atkinson wrote:
I am deploying Python to hundreds of machines using SCCM 2012. I am
using the below command to install:
Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python”
ALLUSERS=1 /qn
Even though I am using /qn, a command prompt still appears at the
Dave Farrance schrieb am 23.02.2015 um 15:13:
Dave Cook wrote:
On 2015-02-22, Dave Farrance wrote:
It's still quicker to do a re-write in the more cumbersome C
You should try Cython.
I did try Cython when I was trying to figure out what to do about the slow
speed. My initial attempt
Changes by Cyd Haselton chasel...@gmail.com:
Removed file:
http://bugs.python.org/file38209/python-3.4.2-androidpatches-1.tar.gz
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23496
___
On 23.02.2015 14:27, Marko Rauhamaa wrote:
pfranke...@gmail.com:
The corresponding call is a call to the python smbus library. It
includes several sleeps (even though they are only about 50ms).
Therefore I think it is worthwhile to encapsulate it into a coroutine.
Maybe. Then you'll
Cyd Haselton added the comment:
Apologies for the tarball, but all patches within are related to this issue
Removing tarball and will re-post individual, cleaned-up patches, grouped by
issue.
Ryan, can you re-do patch for pythonrun.c? If not. I'l. work it in.
--
Thanks for your replies, I will give readline a try.
PS: and you mention being on CentOS but running apt-get. I believe CentOS
and other Red-Hat based distros use yum instead of apt-get
Yes, I think I need to use:
yum install readline-devel
Best regards
David
--
loial wrote:
Is there a quick way to concatenate all the values in a list into a
string, except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help appreciated
strings
['All', 'values', 'in', 'list', 'will', 'be', 'strings']
Steve Dower added the comment:
You're right, SuppressCrashReport also makes more sense here, though it still
needs to be used explicitly in every new process. New patch attached.
--
Added file: http://bugs.python.org/file38210/23314_tf_inhert_check_2.diff
In 12821378-62af-4954-8b61-aa0738c5f...@googlegroups.com loial
jldunn2...@gmail.com writes:
Is there a quick way to concatenate all the values in a list into a string,
except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help
On 2015-02-23 07:58, loial wrote:
Is there a quick way to concatenate all the values in a list into a
string, except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Using
.join(my_list[1:])
should work.
If it is an arbitrary
I've been reworking some of the code in the platform I use at work.
I'm the sole developer/maintainer/hard-core user left, so I can pretty
much do what I want with it (convert modules to Cython, delete no
longer used modules, etc). The platform uses PyGtk, so we use signals
and other features of
On Mon, 23 Feb 2015 07:58:39 -0800, loial wrote:
Is there a quick way to concatenate all the values in a list into a
string, except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help appreciated
''.join(mylist[1:])
all
On 23/02/2015 15:29, Tim Golden wrote:
On 23/02/2015 13:57, Colin Atkinson wrote:
I am deploying Python to hundreds of machines using SCCM 2012. I am
using the below command to install:
Msiexec /i “python.msi” TARGETDIR=”C:\Program Files\Python”
ALLUSERS=1 /qn
Even though I am using /qn,
Is there a quick way to concatenate all the values in a list into a string,
except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help appreciated
--
https://mail.python.org/mailman/listinfo/python-list
Arrgh! I forgot to warn you that you need a very recent version of
virtualenv to work with PyPy. I am very sorry about that. Glad to
see that things are working now.
Laura
--
https://mail.python.org/mailman/listinfo/python-list
On 2015.02.23 09:58, loial wrote:
Is there a quick way to concatenate all the values in a list into a string,
except the first value?
I want this to work with variable length lists.
All values in list will be strings.
Any help appreciated
The tutorial covers strings and lists:
On 23.02.15 04:55, Chris Angelico wrote:
I agree, the fault is primarily with Windows. But I've seen similar
issues when people use /-\| for box drawing and framing and such;
Windows paths are by far the most common case of this, but not the
sole.
There is also issues with regular expressions.
Demian Brecht added the comment:
Pending review of the exceptions from another core dev, the patch looks good to
me. Thanks for sticking with it :)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3566
Martin Panter added the comment:
Rev3 still seems to have the same weird indentation as rev2. Are you using some
sort of diff --ignore-all-space option by accident?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15955
Peter Otten __pete...@web.de:
The OP explicitly mentions the operator. There's no python analog to
that and the behavior shown below:
$ cat pointers.c
#include stdio.h
int main()
{
int a = 2, b = 5;
int * Li[2] = { a, b };
printf(%d %d\n, *Li[0], *Li[1]);
a = 3;
printf(%d
On Sat, 21 Feb 2015 04:15:50 -0800, pfranken85 wrote:
Hello!
I have a best-practice question: Imagine I have several hardware devices
that I work with on the same I2C bus and I am using the python smbus
module for that purpose. The individual devices are sensors, ADC, DAC
components. As I
On Tue, Feb 24, 2015 at 6:06 AM, Marko Rauhamaa ma...@pacujo.net wrote:
What I'm saying is that there's nothing special about Python's object
model or variables. Guido could decide tomorrow to add a C-esque
operator to Python without breaking a single existing Python program.
The Python
On Mon, Feb 23, 2015 at 1:02 PM, sohcahto...@gmail.com wrote:
What's REALLY interesting is that this happens:
import myModule
myModule.myInt
1
myModule.myInt = 2
myModule.myInt
2
del myModule
import myModule
myModule.myInt
2
I would REALLY expect that deleting the module object and
Ian Kelly ian.g.ke...@gmail.com:
Obviously one can use any Turing-complete language to emulate features
of any other Turing-complete language, but I think the point is that
there is no syntactic support for it.
While my contribution was made tongue-in-cheek, there's a grain of
truth in every
Hi all,
We are excited to announce the release of version 0.8.1 of Bokeh, an
interactive web plotting library for Python... and other languages! This
minor release includes many bug fixes and docs improvements:
* Fixed HoverTool
* Fixed Abstract Rendering implementation and docs
* Fixed Charts
New submission from Serhiy Storchaka:
Currently pydoc outputs only two classes and two functions in the types module.
Proposed patch add __all__ into the types module, so that pydoc will output
builtin class deliberately added into the types module.
--
components: Library (Lib)
files:
On Mon, Feb 23, 2015 at 3:14 PM, Ethan Furman et...@stoneleaf.us wrote:
On 02/23/2015 01:00 PM, Tobiah wrote:
Anyway, it raises the question as to whether having '.' in the
PYTHONPATH is at all a sane thing to do.
The current directory is added to sys.path /only/ for the interactive
Serhiy Storchaka added the comment:
Oh, sorry, here is it.
--
keywords: +patch
Added file: http://bugs.python.org/file38208/random_uint32.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23488
Serhiy Storchaka added the comment:
Some microbenchmark results on 32-bit Linux:
$ ./python -m timeit -s from random import getrandbits -- getrandbits(64)
Before: 100 loops, best of 3: 1.41 usec per loop
After: 100 loops, best of 3: 1.34 usec per loop
$ ./python -m timeit -s from
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info:
Yes, but my point is that if some other way solves the problem, then
you should *use that other technique* rather than complain about the
GIL. The GIL is not a bottleneck if you can bypass it.
I can sympathize with somebody who says I
Ben Finney wrote:
Chris Angelico ros...@gmail.com writes:
That said, though, there's probably a lot of code out there that
depends on backslashes being non-special, so it's quite probably
something that can't be changed. But it'd be nice to be able to turn
on a warning for it.
If you're
On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
- and you must be using libraries and tools which prevent you moving to
Jython or IronPython or some other alternative.
I don't get this at all. Why should I not want Python to have the same
Teodor Dima added the comment:
Of course, there's code in the wild that expects and uses the parameter
named 'block' so simply changing this keyword will result in breaking
others' code.
That is, indeed, the case with my company's code as well.
--
STINNER Victor added the comment:
The patch looks good to me.
For utint32_t, see my old issue #17884: Try to reuse stdint.h types like
int32_t.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23488
Hello Marko!
Am Sonntag, 22. Februar 2015 22:21:55 UTC+1 schrieb Marko Rauhamaa:
In asyncio, you typically ignore the value returned by yield. While
generators use yield to communicate results to the calling program,
coroutines use yield only as a trick to implement cooperative
multitasking
Cem Karan wrote:
I tend to structure my code as a tree or DAG of objects. The owner refers to
the owned object, but the owned object has no reference to its owner. With
callbacks, you get cycles, where the owned owns the owner.
This is why I suggested registering a listener object
plus a
Ethan Furman wrote:
On 02/22/2015 11:41 PM, Steven D'Aprano wrote:
If you want *CPython* to work without a GIL, well, are you volunteering
to do the work? It is a massive job, and the core devs aren't terribly
interested. Probably because they understand that the GIL is not often an
Chris Angelico ros...@gmail.com writes:
So, you would have to pass code to the other process, probably. What
about this:
y = 4
other_thread_queue.put(lambda x: x*y)
the y in the lambda is a free variable that's a reference to the
surrounding mutable context, so that's at best dubious. You
New submission from Yassine ABOUKIR:
The module urlparse lacks proper validation of the input leading to open
redirect vulnerability.
The issue is that URLs do not survive the round-trip through
`urlunparse(urlparse(url))`. Python sees `/foo.com` as a URL with no
hostname or scheme and
Laura Creighton wrote:
DO NOT REBUILD PYTHON ON CENTOS!
It can break the whole package management system
which depends on having a particular version of python installed.
If you are running Centos you need to use virtualenv to be safe.
Laura
Almost right!
You can install Python from
Ben Finney wrote:
In C language, there is A for address of A
There is no “address of a value” concept in Python. You access a value
by some reference, either a name or an item in a collection. When a
reference changes to reference some different value, other references
are not affected.
On Tue, Feb 24, 2015 at 4:27 PM, Paul Rubin no.email@nospam.invalid wrote:
Sure, your code might not be making any mutations (that you know of),
but malloc definitely is [1], and that's just the tip of the iceberg.
Other things like buffers for stdin and stdout, DNS resolution etc.
all have
Paul Rubin wrote:
With threads in a single process, this isn't a problem. They all
access the same memory space, so they can all share state. As soon as
you go to separate processes, these considerations become serious.
Right, that's a limitation of processes compared to threads.
I think
Chris Angelico wrote:
On Mon, Feb 23, 2015 at 6:41 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
- and you must be using libraries and tools which prevent you moving to
Jython or IronPython or some other alternative.
I don't get this at all. Why should I not want Python
Ryan Stuart ryan.stuart...@gmail.com writes:
I'm not sure what else to say really. It's just a fact of life that
Threads by definition run in the same memory space and hence always
have the possibility of nasty unforeseen problems. They are unforeseen
because it is extremely difficult (maybe
On Tue, Feb 24, 2015 at 5:56 PM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
Most people are not using the bleeding edge version of Python, and even
those who do, aren't usually using it in production. There are still plenty
of people using Python 2.3 in production, and even a
Martin Panter added the comment:
I am posting a new version of Daniel’s patch as
issue4806-star-TypeError.v2.patch:
* Merged with recent “default” (3.5) branch
* Dropped the documentation fix, since revision a8aa918041c2 already fixed that
in an identical fashion
* Changed to a “look before
Ned Deily wrote:
In article 54ebdcfa$0$11100$c3e8...@news.astraweb.com,
Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote:
Almost right!
You can install Python from source. Unzip the source tar ball, cd into
the source directory, and run:
./configure
make
BUT do *not* run
83 matches
Mail list logo