Andrew Dalke added the comment:
Again, I do not propose any changes to the existing optimizer. I do not need
anything changed for my code to work.
My goal is to counter-balance comments which suggest that perfectly normal code
is somehow folly and arcane. These caused me some bewilderment and
New submission from Andrew Dalke:
The peephole optimizer is an overall benefit to Python but it has some
side-effects that occasionally cause problems. These are well-known in the
issue tracker, but there is no other documentation which will help a Python
programmer figure out which
Changes by Andrew Dalke :
--
nosy: -dalke
___
Python tracker
<http://bugs.python.org/issue30440>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andrew Dalke added the comment:
I do not think quoting the Zen of Python helps anything. As I wrote, "it gives
different answers depending on where one draws the line." This includes
"practicality beats purity".
>From my viewpoint, the peephole optimizer isn't
Andrew Dalke added the comment:
A complex solution is to stop constant folding when there are more than a few
levels of tuples. I suspect there aren't that many cases where there are more
than 5 levels of tuples and where constant creation can't simply be assigned
and used a
Andrew Dalke added the comment:
I know this issue was closed many years ago, and I don't propose re-opening it.
I write this comment because some of the earlier comments here make it sound
like only a foolish or perverse programmer might be affected by this 'too
aggressive consta
New submission from Andrew Dalke:
Others have reported issues like #21074 where the peephole compiler generates
and discards large strings, and #30293 where it generates multi-MB integers and
stores them in the .pyc.
This is a different issue. The code:
def tuple20():
return 1
New submission from Andrew Dalke:
The unittest assertRaises/assertRaisesRegex implementation calls
traceback.clear_frames() because of issue9815 ("assertRaises as a context
manager keeps tracebacks and frames alive").
However, if the traceback is from an exception created in a
New submission from Andrew Dalke:
The file iterator is "deemed broken". As I don't think it should be made
non-broken, I suggest the documentation should be changed to point out when
file iteration is broken. I also think the term 'broken' is a label with
needless
Andrew Dalke added the comment:
Live and learn. I did my first bisect today.
The first bad revision is:
changeset: 51920:ef8fe9088696
branch: legacy-trunk
parent: 51916:4e1556012584
user:Jeffrey Yasskin
date:Sat Feb 28 19:03:21 2009 +
summary: Backport
New submission from Andrew Dalke:
Python's compiler has quadratic-time time behavior based on the number of "and"
or "or" expressions. A profile shows that stackdepth_walk is calling itself in
a stack at least 512 levels deep. (My profiler doesn't go higher tha
Andrew Dalke added the comment:
It does look like #8104 resolved it. I tested on 2.7.2 and verified that it's
no longer a problem, so I moved this to "closed/duplicate".
--
resolution: -> duplicate
status: open -> closed
___
Andrew Dalke added the comment:
My belief is that the people who use set.intersection with more than two terms
are 1) going to pass in a list of sets, and 2) don't care about the specific
order.
To check the validity of my belief, I did a Google Code Search to find cases of
people usin
New submission from Andrew Dalke :
In Issue3069, Arnaud Delobelle proposed support for multiple values to
set.intersection() and set.union(), writing "Intersection is optimized by
sorting all sets/frozensets/dicts in increasing order of size and only
iterating over elements in the sma
Andrew Dalke added the comment:
I confirm that under Python 2.7.2 while trying to build a 3rd-party package
(from rdkit.org) I get the error
Linking CXX shared library ../../lib/libRDBoost.dylib
ld: warning: path '/usr/local/lib/libpython2.7.a' following -L not a directory
Undefin
Andrew Dalke added the comment:
Well that's ... interesting. While I compiled 2.7 and was looking at the 2.7
code my tests were against 2.6.
Python 2.7 (trunk:74969:87651M, Jan 2 2011, 21:58:12)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright&quo
New submission from Andrew Dalke :
complex("nan") raises "ValueError: complex() arg is a malformed string" while
complex(float("nan")) returns (nan+0j). This was reported in
http://bugs.python.org/issue2121 with the conclusion "wont fix".
com
New submission from Andrew Dalke :
doctest.html Section 24.2.5 "Unittest API" says:
def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite(my_module_with_doctests))
return test
That last line should be "return tests"
--
assignee: d.
Andrew Dalke added the comment:
Since I see the change to "test needed", I've attached a diff against Python
2.6's test_socket.py. I would have generated one against the 2.7 version in
subversion but that test doesn't exit.
--
keywords: +patch
Added fil
New submission from Andrew Dalke :
In Python 2.6 and Python 2.7a2+, I can't socket.recv_into(a byte array
instance).
I get a TypeError which complains about a "pinned buffer". I have only an
inkling of what that means. Since an array.array("b") works there, and
New submission from Andrew Dalke :
I have Firefox and Safari installed on my Mac. Safari is the default.
I wanted to try out Crunchy (http://code.google.com/p/crunchy/). It's
developed under Firefox and does not work under Safari. I tried. ;)
It starts the web browser with the foll
Andrew Dalke added the comment:
Wasn't thinking. I'm not quoting from "RFC 405", I'm quoting the 405
section from RFC 2616.
--
___
Python tracker
<http
New submission from Andrew Dalke :
BaseHTTPServer.BaseHTTPRequestHandler.responses contains a mapping from
HTTP status codes to the 2-ple (shortmessage, longmessage), based on RFC
2616.
The 2-ple for 405 is ('Method Not Allowed','Specified method is invalid
for this server.
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
I'm still undecided on if this is a bug or not. The problem occurs even
when I'm not reading "data from a file of an unknown size." My example
causes a MemoryError on my machine even though the file I'm
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
Yes, that installed Python 2.6 into the correct location (C:\Python26
instead of into the root directory).
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
I also have this problem. (2.5 msi installer under Win2K with a non-
admin account granted admin privs). Python installs just fine under
C:\ (instead of C:\Python25) but then I run into problems installing
the win32 extensions.
Sea
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
FreeBSD is why my hosting provider uses. Freebsd.org calls 2.6 "legacy"
but the latest update was earlier this year.
There is shared history with Macs. I don't know the details though. I
just point out that the
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
You're right. I mistook the string implementation for the list one
which does keep a preallocated section in case of growth. Strings of
course don't grow so there's no need for that.
I tracked the memory allocatio
Andrew Dalke <[EMAIL PROTECTED]> added the comment:
I tested it with Python 2.5 on a Mac, Python 2.5 on FreeBSD, and Python
2.6b2+ (from SVN as of this morning) on a Mac.
Perhaps the memory allocator on your machine is making a promise it can
New submission from Andrew Dalke <[EMAIL PROTECTED]>:
I wrote a buggy PNG parser which ended up doing several file.read(large
value). It causes a MemoryError, which was strange because the file was
only a few KB long.
I tracked it down to the implementation of read(). When given
Andrew Dalke added the comment:
I've been working from the Grammar file from CVS for 2.6 ... I thought.
For example, I see "# except_clause: 'except' [test [('as' | ',')
test]]" which is a 2.6-ism.
"svn log" says it hasn't changed s
Andrew Dalke added the comment:
This really is a minor point. I don't track the 3K list and I see now that the
compiler module won't be in Python 3k - good riddance - so feel free to discard
this as well as the other open compiler module bugs.
I want to experiment with adding instr
New submission from Andrew Dalke:
Python 2.6a0 (trunk:60565M, Feb 4 2008, 01:21:28)
[GCC 4.0.1 (Apple Computer, Inc. build 5367)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from compiler import parse
&
New submission from Andrew Dalke:
I wrote a translator from the CFG used in the Grammar file into a form for PLY.
I
found one problem with
varargslist: ((fpdef ['=' test] ',')*
('*' NAME [',' '**' NAME] | '**'
New submission from Andrew Dalke:
The reference manual documentation for raw string literals says
"""Note also that a single backslash followed by a newline is
interpreted as those two characters as part of the string, *not* as a line
continuation."""
This is not
Andrew Dalke added the comment:
Ahh, so the bug here that the environ dict should use neither UserDict nor
dict, it should implement the core {get,set,del}item and keys and use
DictMixin.
Martin mentioned that the patch doesn't support setdefault. He didn't note
though that the cu
Andrew Dalke added the comment:
I should have added my preference. I would like to see UserDict replaced with
dict. I didn't like seeing the extra import when I was doing my performance
testing, through truthfully it's not a bit overhead.
As for future-proofing, of course when
Andrew Dalke added the comment:
I was optimization tuning and wondered why UserDict was imported by os.
Replacing
UserDict with dict passes all existing regression tests.
I see the concerns that doing that replacement is not future proof. Strange
then
that Cookie.py is acceptable. There
New submission from Andrew Dalke:
Current text in README:
See Mac/OSX/README for more information on framework and
universal builds.
Should be
See Mac/README for more information on framework and
universal builds.
because r46719 moved Mac/OSX/* one level up
39 matches
Mail list logo