Well... 63 bytes per item for very short unicode strings... Is there
any way to do better than that? Perhaps some compact unicode objects?
There is a certain price you pay for having full-feature Python objects.
Are there any *compact* Python objects? Optimized for compactness?
What are
On Fri, Aug 6, 2010 at 6:39 PM, dmtr dchich...@gmail.com wrote:
snip
Well... 63 bytes per item for very short unicode strings... Is there
any way to do better than that? Perhaps some compact unicode objects?
If you think that unicode objects are going to be *smaller* than byte
strings, I
Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
Personally, I'd rather see how a potential hire *tests* his code than how
he writes it. Writing code is easy. Testing code is harder. Testing it
properly is harder still -- it's amazing how many people forget that it's
not just
I'm running into some performance / memory bottlenecks on large lists.
Is there any easy way to minimize/optimize memory usage?
Simple str() and unicode objects() [Python 2.6.4/Linux/x86]:
sys.getsizeof('') 24 bytes
sys.getsizeof('0')25 bytes
sys.getsizeof(u'')28 bytes
In message mailman.1681.1281102958.1673.python-l...@python.org, David
Cournapeau wrote:
I have yet seen a project where you could build C code with a C++
compiler - the only ones I know are specifically designed that way and
it is painful.
I seem to recall a FAQ entry, might have been on
On Aug 6, 2010, at 3:14 PM, W. eWatson wrote:
I must be missing something. I tried this. (Windows, IDLE, Python 2.5)
Yes, as Benjamin Kaplan pointed out and as I said in the email where I
posted this code snippet, dependencies is a list of custom classes
that represent modules we need
dmtr:
What I'm really looking for is a dict() that maps short unicode
strings into tuples with integers. But just having a *compact* list
container for unicode strings would help a lot (because I could add a
__dict__ and go from it).
Add them all into one string or array and use indexes
On Fri, Aug 6, 2010 at 6:25 PM, Steven D'Aprano
st...@remove-this-cybersource.com.au wrote:
On Sat, 07 Aug 2010 06:37:05 +1000, James Mills wrote:
On Sat, Aug 7, 2010 at 6:28 AM, geremy condra debat...@gmail.com
wrote:
If I had to wait 5 minutes while a candidate tried to solve this
problem
On 08/06/10 15:37, James Mills wrote:
On Sat, Aug 7, 2010 at 6:28 AM, geremy condradebat...@gmail.com wrote:
If I had to wait 5 minutes while a candidate tried to solve this
problem I would not hire them.
Yes you do raise a valid point. It should really only take
you a mere few seconds or so
From the emperor's new clothes department:
1) Why do Python lists start with element [0], instead of element [1]?
Common sense would seem to suggest that lists should start with [1].
2) In Python 3, why is print a function only, so that: print Hello, World
is not okay, but it must be
On Fri, 2010-08-06 at 22:05 -0500, Default User wrote:
From the emperor's new clothes department:
1) Why do Python lists start with element [0], instead of element
[1]? Common sense would seem to suggest that lists should start
with [1].
Common sense is wrong. There are many compelling
I am currently using threading.timer to execute an event in my big chunk of
code. This is causing a problem with sqlite, so I am trying to figure out the
sched function
import sched
import time
def timerfunc():
print hello, time.time()
return(time.time())
def delay(period):
Default User wrote:
From the emperor's new clothes department:
1) Why do Python lists start with element [0], instead of element [1]?
Common sense would seem to suggest that lists should start with [1].
http://userweb.cs.utexas.edu/users/EWD/transcriptions/EWD08xx/EWD831.html
2) In
Steven D'Aprano st...@remove-this-cybersource.com.au writes:
On Thu, 05 Aug 2010 12:07:53 -0400, wheres pythonmonks wrote:
P.S. Sorry for the top-post -- is there a way to not do top posts
from gmail? I haven't used usenet since tin.
Er, surely you can just move the cursor before you
On Aug 6, 6:56 pm, dmtr dchich...@gmail.com wrote:
Well... 63 bytes per item for very short unicode strings... Is there
any way to do better than that? Perhaps some compact unicode objects?
There is a certain price you pay for having full-feature Python objects.
Are there any *compact*
On Fri, Aug 6, 2010 at 8:05 PM, Default User hunguponcont...@gmail.com wrote:
From the emperor's new clothes department:
1) Why do Python lists start with element [0], instead of element [1]?
Common sense would seem to suggest that lists should start with [1].
(In addition to the other good
On 08/06/2010 07:56 PM, dmtr wrote:
Ultimately a dict that can store ~20,000,000 entries: (u'short
string' : (int, int, int, int, int, int, int)).
I think you really need a real database engine. With the proper
indexes, MySQL could be very fast storing and retrieving this
information for you.
Eli Bendersky eli...@gmail.com added the comment:
TestCoverage.test_coverage_ignore fails when running in verbose mode (python
regrtest.py -v test_trace, or directly python test_trace.py), because it
attempts to compare stdout.getvalue() with the empty string, while verbose
places output
Eli Bendersky eli...@gmail.com added the comment:
The test class added into test_trace.py in issue 3821 fails in verbose mode
(see my message http://bugs.python.org/msg113076). I'm merging that class into
my larger test_trace.py and will fix this problem, unless you guys have other
ideas.
Gerhard Häring g...@ghaering.de added the comment:
Fixed in r83747.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3854
___
New submission from John Regehr reg...@cs.utah.edu:
I ran make test for today's Python3k snapshot under a tool which detects math
operations that the C language considers to have undefined behavior. This was
on x86 Linux. The list of undefined behaviors is attached. Hopefully they are
Eli Bendersky eli...@gmail.com added the comment:
I'm attaching a new patch for unit-testing of trace.py. Changes:
1. Fixed the problems that caused failures when run through regrtest
2. Added the test class from issue 3821
3. Removed the fake module creation, replacing it with a directory
New submission from Eli Bendersky eli...@gmail.com:
eli...@eliben-desktop:~/python_src/svn-27-maint/Lib/test$ py27 regrtest.py
test_complex.py
test_complex
test test_complex failed -- Traceback (most recent call last):
File /home/eliben/python_src/27-maint/Lib/test/test_complex.py, line 563,
Changes by Eli Bendersky eli...@gmail.com:
--
components: +Tests
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9531
___
___
Python-bugs-list
Eli Bendersky eli...@gmail.com added the comment:
Sorry, I didn't build (make) the python executable before reporting. Everything
works, so I'm closing the issue.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
Eli Bendersky eli...@gmail.com added the comment:
I think it makes sense to commit the same patch to 2.7, is this planned?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9264
___
Marc-Andre Lemburg m...@egenix.com added the comment:
I believe _time module should become the home of the gettimeofday() method
and pure python implementation of time.time() will be
def time()
s, us = _time.gettimeofday()
return s + 1e-6 * us
Similarly time.sleep() can be
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
These changes are very aggressive and may be doing more harm than good.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9528
New submission from denny markfile...@126.com:
Hi all
My environment is python 2.4.4 on linux. I am encountering hang of pipe.read()
in commands.getstatusoutput for multi-threading code.
I have spawned several threads which will call commands.getstatusoutput to run
cli. However, pipe.read
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
Although I did finally manage to explain the point of this patch (after a long,
long discussion), I think the issue is still too controversial. We did, for
example, see some strange behaviour in my last comment (Date: 2010-04-21
Mark Dickinson dicki...@gmail.com added the comment:
Thanks for the report. Also applies to 3.1 and 3.2 (and 2.6, but it's too late
to fix things there). I agree that those (int) casts look wrong---I suspect
they're leftovers from the big int - Py_ssize_t switch that happened for
Python
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
The latter. But I'd really like Antoine to look this over.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8411
___
Ezio Melotti ezio.melo...@gmail.com added the comment:
Can the attached script be converted in a unittest that tests that the fix is
correct?
--
nosy: +ezio.melotti
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8757
Mark Dickinson dicki...@gmail.com added the comment:
This is good stuff! Thank you! I'll look through these.
Is the tool you used publicly available?
--
assignee: - mark.dickinson
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
Ray.Allen ysj@gmail.com added the comment:
Why not close this issue? It seems that this has been fixed in current py3k
branch.
--
nosy: +ysj.ray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8306
Steven Bethard steven.beth...@gmail.com added the comment:
Unassigning, because it's likely I won't have time to work on this for a while.
I still think it would be a nice feature. ;-)
--
assignee: bethard -
___
Python tracker
New submission from Roald de Vries pyt...@roalddevries.nl:
Exception raised::
Traceback (most recent call last):
File bug.py, line 5, in module
class derived(type, Sized):
File
/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/abc.py,
line 85, in
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
See r83757, r83756, and r83755.
The existing unittests prove the script does what it is supposed to do. The
new code is just a different approach to the same problem so that it is less
likely to be user visible.
The
Changes by Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp:
--
dependencies: +Improve condition variable emulation on NT
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9116
___
New submission from Valentine Gogichashvili val...@gmail.com:
When the process is dying with the exception trace dump, I am getting the
following notification from the destructor of the OrderedDict class::
Exception AttributeError: 'NoneType' object has no attribute 'print_exc' in
bound
Troy J. Farrell t...@entheossoft.com added the comment:
I figured it was probably too late, but one can always hope. :)
While you sort out who gets to review this, I'll see if I can't work out a
patch for 2.7. It also occurred to me last night that I should probably add a
comment to it.
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9530
___
___
Python-bugs-list mailing
Mark Dickinson dicki...@gmail.com added the comment:
Here are some fixes for Objects/bytesobject.c and Objects/bytearrayobject.c.
More to come.
--
keywords: +patch
versions: +Python 3.2 -Python 3.3
Added file: http://bugs.python.org/file18415/issue9530_1.patch
John Regehr reg...@cs.utah.edu added the comment:
Hi Mark-- Glad it's useful! We plan to release this tool but haven't done so
yet, it still has rough edges. It's LLVM-based and it seems likely they will
take our patches.
--
___
Python tracker
Changes by Guido van Rossum gu...@python.org:
--
nosy: -gvanrossum
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9527
___
___
Python-bugs-list
Changes by Guido van Rossum gu...@python.org:
--
nosy: -gvanrossum
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1647654
___
___
Python-bugs-list
Daniel Stutzbach dan...@stutzbachenterprises.com added the comment:
It is easy in online communications to interpret a response as a disagreement.
I apologize for falling into that trap.
I am +1 on removing implicit set-to-frozenset conversions, which would more
effectively fix issue8752 for
R. David Murray rdmur...@bitdance.com added the comment:
Header parsing and formatting is one of the major changes in email6, and it
should handle this much more sensibly. email6 won't land until 3.3, though it
will be available on pypy for testing before that. If you want propose a patch
Tim Golden m...@timgolden.me.uk added the comment:
Committed in r83759 r83760 r83761
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3210
___
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
On Fri, Aug 6, 2010 at 3:44 AM, Marc-Andre Lemburg
rep...@bugs.python.org wrote:
..
Why are you calling the ticket *Add* pure Python implementation of time
module to CPython when you appear to be after *replacing* the C
New submission from Greg Brockman g...@mit.deu:
Upon os.fork(), pending signals are inherited by the child process. This can
be demonstrated by pressing C-c in the middle of the
following program:
import os, sys, time, threading
def do_fork():
while True:
if not os.fork():
New submission from John Posner jjpos...@optimum.net:
The documentation for collections.defaultdict is confusing with respect to the
__missing__ method. The fact is that a programmer using defaultdict does not
need to know anything about __missing__.
The attached patch contains a rewrite of
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7443
___
___
Python-bugs-list
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue4708
___
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1714451
___
Changes by Tim Golden m...@timgolden.me.uk:
--
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1681974
___
___
Python-bugs-list
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1672853
___
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1707753
___
Changes by Tim Golden m...@timgolden.me.uk:
--
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1142
___
___
Python-bugs-list
Changes by Tim Golden m...@timgolden.me.uk:
--
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6609
___
___
Python-bugs-list
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6839
___
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
nosy: +tim.golden
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8006
___
Changes by Tim Golden m...@timgolden.me.uk:
--
assignee: - tim.golden
components: +Windows
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2304
___
Hirokazu Yamamoto ocean-c...@m2.ccsnet.ne.jp added the comment:
Sorry for posting to closed entry, but I think handle should be closed in
Lib/subprocess.py not in PC/_subprocess.c. I noticed following code showed
strange error.
import subprocess
for _ in xrange(2):
stdout =
Changes by Daniel Urban urban.dani...@gmail.com:
--
nosy: +durban
type: compile error - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9533
___
Tim Golden m...@timgolden.me.uk added the comment:
Blast. Thanks; I'll have to rework those patches then.
--
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3210
___
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
assignee: - rhettinger
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9534
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Do you have a short script that can reproduce the error message?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9534
Valentine Gogichashvili val...@gmail.com added the comment:
Unfortunately I do not have a short script. It is happening during the failure
in quite a big script. I am afraid, it will too time consuming for me to write
it...
Actually by the content of the OrderdDict instance that is throwing
Terry J. Reedy tjre...@udel.edu added the comment:
Fine with me.
Alexander, do you have the fixed up version you committed to 2.6, or should Eli
revise the attachment here for 2.7?
--
___
Python tracker rep...@bugs.python.org
Terry J. Reedy tjre...@udel.edu added the comment:
OK. I would probably be better to expend energy on the 3.x new GIL, should
issues arise.
--
resolution: - out of date
status: open - closed
___
Python tracker rep...@bugs.python.org
Changes by Guido van Rossum gu...@python.org:
--
nosy: -gvanrossum
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1142
___
___
Python-bugs-list
Kristján Valur Jónsson krist...@ccpgames.com added the comment:
in python/trunk/Lib/urllib2.py, line 1161
It doesn't appear to be an issue in py3k.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7464
nchauvat nicolas.chau...@logilab.fr added the comment:
In case it could be useful, here is how generative/parametrized tests are
handled in logilab.common.testlib
http://hg.logilab.org/logilab/common/file/a6b5fe18df99/testlib.py#l1137
--
nosy: +nchauvat
Mark Lawrence breamore...@yahoo.co.uk added the comment:
Set to needs patch as I don't see why you need a unit test for this build
issue, feel free to change it back if you see fit.
--
nosy: +BreamoreBoy
stage: unit test needed - needs patch
versions: +Python 2.7, Python 3.1, Python
Changes by Mark Dickinson dicki...@gmail.com:
--
nosy: +mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9531
___
___
Python-bugs-list
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
Comments on issue9315.27-maint.5.patch:
1. I think you forgot to svn add Lib/test/__init__.py.
2. Instead of import tracedmodules.testmod, please use something like from
test.tracedmodules import testmod. There is no
Mark Lawrence breamore...@yahoo.co.uk added the comment:
Just flagging this up in case it's dropped under the radar.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6811
Changes by Mark Lawrence breamore...@yahoo.co.uk:
--
assignee: georg.brandl - d...@python
nosy: +d...@python
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7790
___
Mark Lawrence breamore...@yahoo.co.uk added the comment:
As a Windows user I'm not convinced this is worth doing.
--
nosy: +BreamoreBoy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1566260
Florent Xicluna florent.xicl...@gmail.com added the comment:
It behaves as documented. Moved to feature request.
http://docs.python.org/library/xml.etree.elementtree.html
--
components: +XML
type: behavior - feature request
versions: +Python 3.2, Python 3.3 -Python 3.1
Changes by Florent Xicluna florent.xicl...@gmail.com:
--
nosy: +scoder
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9522
___
___
Python-bugs-list
Alexander Belopolsky belopol...@users.sourceforge.net added the comment:
The fixed up version is just r83549. It may merge cleanly with py3k - I believe
doc changes are trivial if any between 2.6 and 3.x.
I would like this to go through another round of reviews without release
calendar
Tim Golden m...@timgolden.me.uk added the comment:
If individual users want to change these around, it's easy enough to do so
post-hoc. Closing as won't fix.
--
nosy: +tim.golden
resolution: - wont fix
___
Python tracker rep...@bugs.python.org
Changes by Tim Golden m...@timgolden.me.uk:
--
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1566260
___
Matthew Barnett pyt...@mrabarnett.plus.com added the comment:
(1) would break existing code. It would also mean that you wouldn't have access
to the start and end positions of the matches either.
(2) would also break existing code which is expecting a list. It's like the
change that happened
Changes by Terry J. Reedy tjre...@udel.edu:
--
stage: - patch review
type: - feature request
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9373
___
Mark Dickinson dicki...@gmail.com added the comment:
This isn't a problem any more: 2.6 and 3.1 are now able to follow symbolic
links. Sorry for the noise!
--
status: open - closed
___
Python tracker rep...@bugs.python.org
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
There's not enough information here for me to follow-up.
It's unlikely that dict.clear() would product the message you see and the
existing code for OrderedDict.__del__ and OrderedDict.clear() look correct to
me. The bug
New submission from Denver Coneybeare denver.coneybe...@gmail.com:
Currently, when a subparser is added to an argparse.ArgumentParser the list of
subparsers are stored in the built-in dict type. When these subparsers are
listed when -h is given on the command line they are showed in the order
R. David Murray rdmur...@bitdance.com added the comment:
This is because python doesn't know the encoding of stdin, and so uses ASCII (I
assume that's what 'charmap' is on windows...on my unix box the error message
mentions ascii, not charmap). You can tell python to use an alternate encoding
Terry J. Reedy tjre...@udel.edu added the comment:
Andrea: for the purpose of this tracker, a 'bug' is a discrepancy between doc
and behavior. The fact that (new-style) classes have circular references was
known when they were introduced in 2.2. That fact is not a bug in the above
sense. It
Brian Curtin cur...@acm.org added the comment:
Fixed in r83763 (py3k), r83764 (release31-maint), and r83765 (release27-maint).
Thanks for reporting this.
--
resolution: - fixed
stage: patch review - committed/rejected
versions: +Python 3.1
___
R. David Murray rdmur...@bitdance.com added the comment:
No, the docs are correct as they stand. They say that without an argument it
acts like locals(), and there is even a special note saying you shouldn't
modify the returned dictionary because what happens when you do is undefined.
It
Changes by David Andrzejewski site+python@davidandrzejewski.com:
--
nosy: +dandrzejewski
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue2475
___
Terry J. Reedy tjre...@udel.edu added the comment:
If I understand, the point is to better hide two functions that must be exposed
for the benefit of .Formatter but which users really should not use. It would
also slightly declutter dir(str) and help(str) which are already unusually
'big'.
Terry J. Reedy tjre...@udel.edu added the comment:
What about the other duplicate pairs with a preferred choice?
Is there too much use of the deprecated choice?
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +ronaldoussoren
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9516
___
___
Mark Dickinson dicki...@gmail.com added the comment:
The idea seems fine to me. Hiding the _string module in
Objects/unicodeobject.c is a little odd, though: why not a new
Modules/_string.c file?
Is the _string module only used by the string module?
--
nosy: +mark.dickinson
Changes by Eric Smith e...@trueblade.com:
--
nosy: +eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9537
___
___
Python-bugs-list mailing
101 - 200 of 226 matches
Mail list logo