Le vendredi 2 mai 2014 05:50:40 UTC+2, Michael Torrie a écrit :
Can't help but feed the troll... forgive me.
On 04/28/2014 02:57 AM, wxjmfa...@gmail.com wrote:
Python 2.7 + cp1252:
- Solid and coherent system (nothing to do with the Euro).
Except that cp1252 is not unicode.
Hi all.
I was wandering why Python implements its __new__ method as a static
and not a class method?
__new__ always accepts a cls parameter, which lead me to believe it
was a class method. Also, implementing __new__ as a class method seems
natural when thinking about __new__ as 'a
Hello all,
I'm using Python 3.4 and am seeing the memory usage of my program grow
unbounded. Here's a snippet of the loop driving the main computation
opt_dict = {'interior':cons_dict['int_eq'],'lboundary':cons_dict['lboundary'],
'rboundary':cons_dict['rboundary'],
International Conference on Engineering, Science and Technology Innovation
(ICESTI 2014)
10-13 September 2014, Bali, Indonesia
http://www.icesti.org/
Contact Email: icesti2...@icesti.org
Online Submission: http://www.icesti.org/online-submission
ICESTI 2014 will provide a forum for accessing
Turns out one of the libraries I am using has a cache system. If I shut if off
then my problem goes away...
On Saturday, May 3, 2014 7:15:59 AM UTC-6, ptb wrote:
Hello all,
I'm using Python 3.4 and am seeing the memory usage of my program grow
unbounded. Here's a snippet of the loop
On Sat, 03 May 2014 12:37:24 +0200, Jurko Gospodnetić wrote:
Hi all.
I was wandering why Python implements its __new__ method as a static
and not a class method?
Have you read Guido's tutorial on it?
https://www.python.org/download/releases/2.2.3/descrintro
[quote]
Factoid: __new__ is
On Sat, 03 May 2014 06:51:02 -0700, icesti2014editor wrote:
sharing best practice in the field of Engineering, Science, and
Technology towards sustainable development.
The first event of this conference series (ICESTI 2014) will be held in
Bali, Indonesia
Let's all fly to Bali in the name
On Sat, 03 May 2014 15:50:40 +, Denis McMahon wrote:
On Sat, 03 May 2014 06:51:02 -0700, icesti2014editor wrote:
sharing best practice in the field of Engineering, Science, and
Technology towards sustainable development.
The first event of this conference series (ICESTI 2014) will be
On Sun, May 4, 2014 at 3:23 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
On Sat, 03 May 2014 15:50:40 +, Denis McMahon wrote:
On Sat, 03 May 2014 06:51:02 -0700, icesti2014editor wrote:
sharing best practice in the field of Engineering, Science, and
Technology towards
On 5/3/2014 6:37 AM, Jurko Gospodnetić wrote:
Hi all.
I was wandering why Python implements its __new__ method as a static
and not a class method?
For a technical internal reason that Guido and maybe others have
explained on pydev (more than once). I forget the details partly because
On 5/3/2014 1:23 PM, Steven D'Aprano wrote:
On Sat, 03 May 2014 15:50:40 +, Denis McMahon wrote:
On Sat, 03 May 2014 06:51:02 -0700, icesti2014editor wrote:
sharing best practice in the field of Engineering, Science, and
Technology towards sustainable development.
The first event of
Hello,
Is there a Python tool or function that can register two images together (line
them up visually), and then crop them to the common overlap area? I'm assuming
this can probably be done with Python Imaging Library but I'm not very familiar
with it yet.
Any help or advice is appreciated!
On 03/05/2014 22:47, mikejohnrya...@gmail.com wrote:
Hello,
Is there a Python tool or function that can register two images together (line
them up visually), and then crop them to the common overlap area? I'm assuming
this can probably be done with Python Imaging Library but I'm not very
pybotwar is a fun and educational game where players
write computer programs to control simulated robots.
http://pybotwar.googlecode.com/
The focus of this release is updating to use the
latest available pybox2d version: 2.3b0
pybotwar uses pybox2d for the physical simulation.
It can be run in
Steven D'Aprano wrote:
I'm not entirely sure what he means by upcalls, but I believe it means
to call the method further up (that is, closer to the base) of the
inheritance tree.
I think it means this:
def __new__(cls):
MyBaseClass.__new__(cls)
which wouldn't work with a class
On Sun, 04 May 2014 11:21:53 +1200, Gregory Ewing wrote:
Steven D'Aprano wrote:
I'm not entirely sure what he means by upcalls, but I believe it
means to call the method further up (that is, closer to the base) of
the inheritance tree.
I think it means this:
def __new__(cls):
akira added the comment:
I can't reproduce it on Ubuntu 12.04 with Python 2.7.3, 2.7.6, 3.2,
tip -- no segfault.
It prints the expected output on both Python 2 and 3:
(standard input)
io-error
(standard input) is printed by grep due to --files-with-match option
io-error (Broken pipe) is
Jurko Gospodnetić added the comment:
Thanks for the detailed response! :-(
I should have tested more before reporting the issue.
Sorry for the noise. :-(
I saw the 'cls' argument and assumed it was a class
method. Having to explicitly specify cls did not
seem to be in contradiction with this
Stefan Behnel added the comment:
LGTM, can't see a case where this might go wrong (errors and type checks are
handled before the added code).
It also seems a sufficiently common case to optimise it internally. The 2**n
spelling is easier to read and to get right than the shifting, so it's
Andrew Svetlov added the comment:
Ok. I agree with Teddy but Raymond's arguments make a value also.
Thus we need to make any decision and close the issue (and bunch of
similar issues).
On Sat, May 3, 2014 at 8:38 AM, Terry J. Reedy rep...@bugs.python.org wrote:
Terry J. Reedy added the
New submission from STINNER Victor:
I propose to add a micro-optimization for int 0: return the number
unmodified.
See attached patch.
--
files: long_lshift0.patch
keywords: patch
messages: 217822
nosy: haypo, mark.dickinson, serhiy.storchaka
priority: normal
severity: normal
status:
STINNER Victor added the comment:
pow2_specialized.patch: here is a different approach, a little bit faster. I
wrote a dedicated long_pow2() function which computes 2**k.
Arguments in favor of pow2_specialized.patch instead of pow2.patch:
- it's a little bit faster
- don't touch
STINNER Victor added the comment:
I can reproduce the crash. It occurs at the line fd.write(data). It looks
like the crash occurs in the C function fwrite() which doesn't handle EPIPE /
SIGPIPE correctly.
Top of the gdb traceback:
#0 0x0033d0a8968b in __mempcpy_sse2 () from
Changes by Brett Cannon br...@python.org:
--
assignee: - brett.cannon
nosy: +brett.cannon
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14019
___
Changes by Tshepang Lekhonkhobe tshep...@gmail.com:
--
nosy: +tshepang
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21352
___
___
Changes by Michele Orrù maker...@gmail.com:
Added file: http://bugs.python.org/file35146/issue18564.3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18564
___
Michele Orrù added the comment:
Interestingly, bluetooth/bluetooth.h implements a function for parsing
bluetooth addresses, but it's completely broken.
https://git.kernel.org/cgit/bluetooth/bluez.git/tree/lib/bluetooth.c#n83
It would be much much more elegant to use str2ba() in our source code
Stefan Krah added the comment:
I did a post-commit review. A couple of things:
1) I think Victor and I have a different view of the calloc() parameters.
calloc(size_t nmemb, size_t size)
If a memory region of bytes is allocated, IMO 'nbytes' should be in the
place of 'nmemb' and
Charles-François Natali added the comment:
I can reproduce the crash. It occurs at the line fd.write(data). It looks
like the crash occurs in the C function fwrite() which doesn't handle EPIPE /
SIGPIPE correctly.
Wouldn't be the first time.
Note that in Python 3, we don't fopen/fwrite
Terry J. Reedy added the comment:
I was thinking the same thing. This appears to be one of the 2.x bugs that have
been fixed in 3.x but not 2.x because backporting the fix might break working
code. If there another sensible fix that would be acceptable in 2.x?
--
Stefan Krah added the comment:
I forgot one thing:
5) If WITH_VALGRIND is defined, nbytes is uninitialized in _PyObject_Alloc().
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21233
___
Charles-François Natali added the comment:
It's segfaulting inside fwrite(), so apart from completely rewriting
the IO layer in 2.x, I don't see.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20866
Stefan Krah added the comment:
Another thing:
6) We need some kind of prominent documentation that existing
programs need to be changed:
Python 3.5.0a0 (default:62438d1b11c7+, May 3 2014, 23:35:03)
[GCC 4.8.2] on linux
Type help, copyright, credits or license for more information.
import
Nathaniel Smith added the comment:
A simple solution would be to change the name of the struct, so that
non-updated libraries will get a compile error instead of a runtime crash.
--
___
Python tracker rep...@bugs.python.org
Andreas Røsdal added the comment:
Here's a patch which implements support in SocketServer to set IPv6 socket
address family to AF_INET6 automatically if the TCPServer is specified to
listen to an IPv6 address. This means that users of the TCPServer class will
get the correct address family
Raymond Hettinger added the comment:
Every branch has a cost (in particular, it tends to contaminate global branch
prediction tables and blow other code out of the L1 code cache). The cost
isn't big, but branches shouldn't be added unless we know there is a real
benefit.
I would think that
Roundup Robot added the comment:
New changeset 725cb631699a by Raymond Hettinger in branch '3.4':
Issue 21375: Fix possible Py_ssizet overflow in heapq.
http://hg.python.org/cpython/rev/725cb631699a
--
nosy: +python-dev
___
Python tracker
Roundup Robot added the comment:
New changeset b768d41dec0a by Raymond Hettinger in branch '2.7':
Issue 21375: Fix possible Py_ssizet overflow in heapq.
http://hg.python.org/cpython/rev/b768d41dec0a
--
___
Python tracker rep...@bugs.python.org
STINNER Victor added the comment:
I would think that in real-world code, this branch will almost never be
taken. The common case will pay a price (albiet a small one) for almost
zero benefit.
I think that x 0 is common even if it's not written like that (it's more
for i in range(8): ... x
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21375
___
STINNER Victor added the comment:
6) We need some kind of prominent documentation that existing
programs need to be changed:
My final commit includes an addition to What's New in Python 3.5 doc,
including a notice in the porting section. It is not enough?
Even if the API is public, the
STINNER Victor added the comment:
5) If WITH_VALGRIND is defined, nbytes is uninitialized in
_PyObject_Alloc().
Did you see my second commit? It's nlt already fixed?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21233
Stefan Krah added the comment:
5) If WITH_VALGRIND is defined, nbytes is uninitialized in
_PyObject_Alloc().
Did you see my second commit? It's nlt already fixed?
I don't think so, I have revision 5d076506b3f5 here.
--
___
Python tracker
STINNER Victor added the comment:
allocate nbytes elements of size 1
PyObject_Malloc(100) asks to allocate one object of 100 bytes.
For PyMem_Malloc() and PyMem_RawMalloc(), it's more difficult to guess, but
IMO it's sane to bet that a single memory block of size bytes is requested.
I
Ned Deily added the comment:
I agree: issue21121-3.diff is a much better approach.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21121
___
___
Raymond Hettinger added the comment:
Based on all the negative comments, I'm closing this one. It adds too much
complication in return for dubious value.
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Stefan Krah added the comment:
STINNER Victor rep...@bugs.python.org wrote:
PyObject_Malloc(100) asks to allocate one object of 100 bytes.
Okay, then let's please call it:
_PyObject_Calloc(void *ctx, size_t nobjs, size_t objsize)
_PyObject_Alloc(int use_calloc, void *ctx, size_t nobjs,
Roundup Robot added the comment:
New changeset 39f475aa0163 by Raymond Hettinger in branch 'default':
Issue 21101: Internal API for dict getitem and setitem where the hash value is
known.
http://hg.python.org/cpython/rev/39f475aa0163
--
nosy: +python-dev
New submission from Andreas van Cranenburgh:
It would be useful if concurrent.futures.ThreadPoolExecutor took an initializer
argument, like multiprocessing.Pool.
This is useful for example to load a large dataset once upon initialization of
each worker process, without have to pass the
Larry Hastings added the comment:
If you guys want this in 3.4.1, please get it checked in in the next, oh, eight
hours.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21121
___
Roundup Robot added the comment:
New changeset 592a57682ced by Raymond Hettinger in branch 'default':
Issue #21101: Eliminate double hashing in the C code for collections.Counter().
http://hg.python.org/cpython/rev/592a57682ced
--
___
Python tracker
Changes by Raymond Hettinger raymond.hettin...@gmail.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21101
___
Roundup Robot added the comment:
New changeset 57dacba9febf by Benjamin Peterson in branch '3.4':
improve test coverage of filecmp (closes #21357)
http://hg.python.org/cpython/rev/57dacba9febf
New changeset c597654a7fd8 by Benjamin Peterson in branch 'default':
merge 3.4 (#21357)
Roundup Robot added the comment:
New changeset 0df3004581fe by Benjamin Peterson in branch 'default':
improve idioms (closes #20642)
http://hg.python.org/cpython/rev/0df3004581fe
--
nosy: +python-dev
resolution: - fixed
stage: - resolved
status: open - closed
Raymond Hettinger added the comment:
This was a nice patch.
Thanks.
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20642
___
Roundup Robot added the comment:
New changeset 2c6a231e2c1e by Raymond Hettinger in branch 'default':
Issue #21421: Add __slots__ to the MappingViews ABCs.
http://hg.python.org/cpython/rev/2c6a231e2c1e
--
nosy: +python-dev
___
Python tracker
Raymond Hettinger added the comment:
I've applied the __slots__ patch. Thank you for submitting it.
Am leaving the rest of the ABCs code as-is. The current form may be a bit
wordy but it is clean, fast, and easy to trace through a debugger. The
expanded forms were chosen for a reason.
Raymond Hettinger added the comment:
I've looked into this a bit more. Even in Haskell, it seems that use case is
for str.join() which we already have. I don't see intersperse() in any other
functional languages. That suggests that its use cases aren't sufficiently
common to warrant adding
Roundup Robot added the comment:
New changeset 7ecb6e4b1077 by Ned Deily in branch '3.4':
Issue #18604: Skip the Tk instantiation test on OS X because it can
http://hg.python.org/cpython/rev/7ecb6e4b1077
New changeset 7f6d9990a9b1 by Ned Deily in branch 'default':
Issue #18604: merge from 3.4
Ned Deily added the comment:
For some reason, the newly-added Tk instantiation check causes the OS X Cocoa
Tk to segfault when tests are run under regrtest -jn option, which causes each
test to be run under a separate subprocess called from a separate thread.
Somewhat surprisingly, the
Roundup Robot added the comment:
New changeset a3c345ba3563 by Raymond Hettinger in branch 'default':
Issue #19414: Have the OrderedDict mark deleted links as unusable.
http://hg.python.org/cpython/rev/a3c345ba3563
--
nosy: +python-dev
___
Python
Raymond Hettinger added the comment:
To address Armin's concern, I'm triggering an early failure by setting the link
fields to None. That will help prevent accidental reliance on non-guaranteed
behaviors.
--
resolution: - fixed
status: open - closed
New submission from Raymond Hettinger:
Consolidate the logic for nlargest() into a single function. Remove both the C
and pure Python base underlying code.
With all the logic in a single function, it only becomes necessary to create,
store, and compare the data tuples when a need item is
63 matches
Mail list logo