David M. Beazley <[EMAIL PROTECTED]> added the comment:
I agree with previous comments that write() should definitely write all
data when in blocking mode.
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
New submission from David W. Lambert <[EMAIL PROTECTED]>:
http://docs.python.org/dev/3.0/reference/datamodel.html#special-lookup
(After fixing the link to http://docs.python.org/3.0 at
http://www.python.org/doc/ (and likewise the
http://docs.python.org/whatsnew/3.0.html link.)...
The c
David W. Lambert <[EMAIL PROTECTED]> added the comment:
>>> class c:
... def __getattribute__(self,*args):
... print('getattribute chimes in')
...
>>> c()+3
Traceback (most recent call last):
File "", line 1, in
TypeError: uns
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Meanwhile, use
http://docs.python.org/dev/3.0/
--
nosy: +LambertDW
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
Changes by David W. Lambert <[EMAIL PROTECTED]>:
--
nosy: -LambertDW
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4518>
___
__
New submission from R. David Murray <[EMAIL PROTECTED]>:
I ran my ap with -3 and got the following:
/usr/lib/python2.6/logging/__init__.py:849: DeprecationWarning:
dict.has_key() not supported in 3.x; use the in operator
--
components: Library (Lib)
messages: 76883
nosy: bit
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Try this---
def List_to_String(lis,separator=''):
return separator.join(lis)
--
nosy: +LambertDW
___
Python tracker <[EMAIL PROTECTED]>
<http://
David W. Lambert <[EMAIL PROTECTED]> added the comment:
I did this to find out what are str.join's arguments---
$ python3 -c 'help(str.join)'
Help on method_descriptor:
join(...)
S.join(sequence) -> str
Return a string which is the concatenation of the str
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Opinion---"Batteries included" doesn't mean "a bewildering variety of
functions". Nor does it mean "my programming language has a checklist
of features" such as I recall the spreadsheet and word
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Yes to msg77021. However!
I'll pin the difficulty specifically to the word "may". This cost me a
lot of time.
1) Please change the phrasing you quoted to
"... implicit special method lookup bypasses the __ge
David M. Beazley <[EMAIL PROTECTED]> added the comment:
I've done some profiling and the performance of reading line-by-line is
considerably worse in Python 3 than in Python 2. For example, this
code:
for line in open("somefile.txt"):
pass
Ran 35 times slower in P
David M. Beazley <[EMAIL PROTECTED]> added the comment:
Tried this using projects/python/branches/release30-maint and using the
patch that was just attached. With a 66MB input file, here are the
results of this code fragment:
for line in open("BIGFILE):
pass
Python 2.6: 0
David M. Beazley <[EMAIL PROTECTED]> added the comment:
Just as one other followup, if you change the code in the last example
to use binary mode like this:
for line in open("BIG","rb"):
pass
You get the following results:
Python 2.6: 0.64s
Python 3.0:
David M. Beazley <[EMAIL PROTECTED]> added the comment:
Just checked it with branches/py3k and the performance is the same.
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
David M. Beazley <[EMAIL PROTECTED]> added the comment:
bash-3.2$ uname -a
Darwin david-beazleys-macbook.local 9.5.1 Darwin Kernel Version 9.5.1: Fri
Sep 19 16:19:24 PDT 2008; root:xnu-1228.8.30~1/RELEASE_I386 i386
bash-3.2$ ./python.exe -c "import sys; print(sys.version)"
3
New submission from David M. Beazley <[EMAIL PROTECTED]>:
The documentation for the apply() and apply_async() methods of a Pool
object might emphasize that these operations execute func(*args,**kwargs)
in only one of the pool workers and that func() is not being executed in
parallel
David W. Lambert <[EMAIL PROTECTED]> added the comment:
I expect the answer will be that 2to3 cannot know what sort of object
"string" names. Bell's theorem, or some such, as I understand it, tells
us that you must execute the algorithm to find out what it does, there
i
New submission from David W. Lambert <[EMAIL PROTECTED]>:
$ #rm -f file_that_is_not_here.py
$ 2to3 file_that_is_not_here.py
The program spends considerable time preparing itself only to discover
that it cannot open the file.
--
components: 2to3 (2.x to 3.0 conversion tool)
me
David W. Lambert <[EMAIL PROTECTED]> added the comment:
I think the point is to get a message from 2to3 about possible use of
feature that is gone. Of course python3 raises an exception when trying
to execute the code, but it does leave the user wondering "why did 2to3
report that t
David M. Beazley <[EMAIL PROTECTED]> added the comment:
Actually, you shouldn't discount the potential usefulness of running
apply() in all of the worker nodes. A lot of people coming from
parallel programming know about things like global broadcasts,
reductions, and so forth.
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Granted, this isn't the hottest issue circulating.
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.
Changes by David W. Lambert <[EMAIL PROTECTED]>:
--
nosy: +LambertDW
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4606>
___
__
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Mutable function arguments and class variables are python's mechanisms
to provide data persistence at these scope levels. Quite opposite of
design flaw, they are necessary! Write a decorator to change the
behavior where yo
David W. Lambert <[EMAIL PROTECTED]> added the comment:
Python 3.0rc1+ similar.
--
nosy: +LambertDW
versions: +Python 3.0
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pytho
David W. Lambert added the comment:
It is hard. Although you know what you mean, 2to3 has no way to know
for instance, that you never run your program with working directory
containing file HTMLParser.py.
2to3 could offer a suggestion rather than reporting no change required.
This issue is
David W. Lambert added the comment:
When I use it on python 3 optparse reports no such option -e,
which is correct since the form -debug permits a run of single character
options.
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.
David W. Lambert added the comment:
I do think your interpretation of PEP8 is overly strict. Here's the
source code of the first j interpreter. (Ken Iverson)
typedef char C;typedef long I;
typedef struct a{I t,r,d[3],p[2];}*A;
#define P printf
#define R return
#define V1(f) A f(
David W. Lambert added the comment:
That phrase of PEP 8 means to me "Use spaces to visually group
expressions according to precedence."
___
Python tracker
<http://bugs.python.
David M. Beazley added the comment:
I wish I shared your optimism about this, but I don't. Here's a short
explanation why.
The problem of I/O and the associated interface between hardware, the
operating system kernel, and user applications is one of the most
fundamental and
David M. Beazley added the comment:
Good luck with that. Most people who get bright ideas such as "gee,
maybe I'll write my own version of X" where "X" is some part of the
standard C library pertaining to I/O, end up fighting a losing battle.
Of course, I'd
David M. Beazley added the comment:
I agree with Raymond. For binary reads, I'll go farther and say that
even a 10% slowdown in performance would be surprising if not
unacceptable to some people. I know that as hard as it might be for
everyone to believe, there are a lot of peopl
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue4680>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from David M. Beazley :
The ConfigParser module defines a variety of custom exceptions, many of
which take more than one argument (e.g., InterpolationError,
NoOptionError, etc.). However, none of these exceptions properly set
the .args attribute. For example, shouldn
David W. Lambert added the comment:
(but of course with imap in version 2.7 and with something else in
version 3.x)
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue4
New submission from David M. Beazley :
The documentation for "Proxy Objects" in the multiprocessing module
describes a method "_call_method" and gives various examples. The only
problem is that the method is actually called "_callmethod" (i.e., no
undersc
David M. Beazley added the comment:
The _get_value() method is also in error. It's called "_getvalue()" in
the source code.
___
Python tracker
<http://bugs.py
New submission from David M. Beazley :
In the "Address Formats" part of the "Listeners and Clients" section of
the documentation for the multiprocessing module, AF_PIPE addresses are
described as having this format:
r'ServerName\\pipe\\PipeName'
David M. Beazley added the comment:
Bump. This functionality seems to be needed if anyone is going to be
messing around with advanced features of IPv6. As it stands, the socket
module in Python 2.6/3.0 is incomplete without this.
--
nosy: +beazley
New submission from David M. Beazley :
The documentation for asynchat needs to be more precise in its use of
strings vs. bytes. Unless the undocumented use_encoding attribute is
set, it seems that all data should be bytes throughout (e.g., the
terminator, inputs to push methods, etc.).
I
David M. Beazley added the comment:
Just a followup comment to note that adding support for
sendmsg()/recvmsg() is what you need to do "file descriptor passing"
between processes on Unix---another technique for writing network servers.
___
Pyth
New submission from David M. Beazley :
I have recently completed a pretty thorough survey of library
documentation for Python 3.0 in conjunction with an update I'm making to
my book. This issue is not so much a bug as a documentation request.
For all of the library modules relat
New submission from David W. Lambert :
http://docs.python.org/dev/3.0/whatsnew/3.1.html
To Other Language Changes
add cmp removed.
I haven't installed version 3.1; I don't know if it has actually been
removed.
--
assignee: georg.brandl
components: Documentation
messages:
New submission from David M. Beazley :
Documentation for the email package needs to be more clear about the
usage of strings and bytes. In particular:
1. All operations that parse email messages such as message_from_file()
or message_from_string() operate on *text*, not binary data. So
New submission from David M. Beazley :
The documentation describes classes such as
email.mime.MIMEText()
email.mime.MIMEMultipart()
email.mime.MIMEApplication()
etc...
However, it's confusing because none of these classes are actually found
in email.mime.
Suggest either using the full p
New submission from David M. Beazley :
The email.generator.Generator class does not work correctly message
objects created with binary data (MIMEImage, MIMEAudio, MIMEApplication,
etc.). For example:
>>> from email.mime.image import MIMEImage
>>> data = open("IMG.
New submission from David M. Beazley :
The whole point of base64 encoding is to safely encode binary data into
text characters. Thus, the base64.b64decode() function should equally
accept text strings or binary strings as input. For example, there is a
reasonable expectation that something
David M. Beazley added the comment:
Note: This problem applies to all of the other decoders/encoders in the
base64 too (b16, b32, etc.)
___
Python tracker
<http://bugs.python.org/issue4
New submission from David M. Beazley :
See Issue 4869 for a related bug.
Most of the functions in binascii are meant to go from binary data to
textual representations (hex digits, base64, binhex, etc.). There are
numerous problems:
1. Misleading error messages. For example
David M. Beazley added the comment:
Given the low-level nature of this module, I can understand the
motivation to make it all bytes.
However, I'm going to respectfully disagree with that and claim that
making binascii all bytes really goes against the whole spirit of what
Python 3.
New submission from David M. Beazley :
The hashlib documentation has incorrect examples showing the use of the
hexdigest() method:
>>> hashlib.sha224(b"Nobody inspects the spammish
repetition").hexdigest()
b'a4337bc45a8fc544c03f52dc550cd6e1e87021bc896588bd79e901e2
David M. Beazley added the comment:
The digest() method of hashes does produce bytes (correct). The
hexdigest() method produces a string, but it is also shown as producing
bytes in the examples.
___
Python tracker
<http://bugs.python.org/issue4
New submission from David M. Beazley :
A file-like object u returned by the urlopen() function in both Python
2.6/3.0 has a method info() that returns a 'HTTPMessage' object. For
example:
::: Python 2.6
>>> from urllib2 import urlopen
>>> u = urlopen("ht
David M. Beazley added the comment:
Verified that 2to3 does not fix this.
___
Python tracker
<http://bugs.python.org/issue4773>
___
___
Python-bugs-list mailing list
Unsub
New submission from David M. Beazley :
Documentation for the json module in Python 2.6 and Python 3.0 doesn't
have any description for load() or loads() even though both functions are
used in the examples.
--
assignee: georg.brandl
components: Documentation
messages: 78542
New submission from David M. Beazley :
The json module is described as having an interface similar to pickle:
json.dump()
json.dumps()
json.load()
json.loads()
I think it would be a WISE idea to add a huge warning message to the
documentation that these functions should *NOT
New submission from David M. Beazley :
The strict parameter to JSONDecoder() is undocumented and is confusing
because someone might assume it has something to do with the encoding
parameter or the general handling of parsing errors (which it doesn't).
As far as I can determine by readin
David M. Beazley added the comment:
One more followup. The quopri module (which is highly related to
base64 in that quopri and base64 are often used together within MIME)
does accept both unicode and byte strings when decoding. For example,
this works:
>>> quopri.decodestri
David M. Beazley added the comment:
Just consider me to be an impartial outside reviewer. Hypothetically,
let's say I'm a Python programmer who knows a thing or two about
standard library modules (like pickle), but I'm new to JSON so I come
looking at the json module docum
David M. Beazley added the comment:
Thanks! Hopefully I'm not giving you too much work to do :-).
Cheers,
Dave
___
Python tracker
<http://bugs.python.org/i
New submission from David M. Beazley :
Not a bug, but a question to developers:
Is xml.etree.ElementTree going to be the only standard library module in
Python 3.0 that doesn't follow the standard Python 3.0 module naming
conventions? (e.g., socketserver, configparser, etc.). Are ther
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue4794>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from David M. Beazley :
In the "ctypes reference / Finding shared libraries" section of the ctypes
documentation, the find_library() function is described as being located
in ctypes.util. However, it's formal description right below that lists
it as ctyp
David M. Beazley added the comment:
One further followup just to make sure I'm clear.
Is it always safe to pass the result of locals() into exec and extract
the result as shown in my example?
Since I'm writing about this in a book, I just want to make absolutely
certain I k
New submission from David M. Beazley :
Please forgive me, but I'm really trying to wrap my brain around the
behavior of exec() in Python 3. Here's a quote from the documentation:
"In all cases, if the optional parts are omitted, the code is
executed in the current s
David W. Lambert added the comment:
Mathematica returns an empty list.
In[1]:= Permutations[{1,2},{1}]
Out[1]= {{1}, {2}}
In[2]:= Permutations[{1,2},{4}]
Out[2]= {}
In[3]:=
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.
David W. Lambert added the comment:
Mathematica indicates for the user to define it later. An error.
In[3]:= Permutations[{1,2},{-2}]
Permutations::nninfseq:
Position 2 of Permutations[{1, 2}, {-2}]
must be All, Infinity, a non-negative integer, or a List whose
first
element
David W. Lambert added the comment:
I try to "not know" excel. Does it have any other means to represent an
empty set?
___
Python tracker
<http://bugs.python.
David W. Lambert added the comment:
I had thought highly of the "mull it over for a week" plan. After a
week we'd decide to follow Stephen Wolfram's lead, which seems to be the
current patch. I haven't yet used the python permutations iterator,
although I used to
J. David Ibáñez added the comment:
I believe I have hit this bug. With Python 2.6.1 in a Gentoo Linux
64 bits.
This code:
from zipfile import ZipFile
inzip = ZipFile('Document.odt')
outzip = ZipFile('out.zip', 'w')
for f in inzip.infolist():
David W. Lambert added the comment:
I disagree. Purpose of __doc__ is to explain functionality all at once.
This command idiom is useful:
$ python -c 'from a_module import thing; help(thing)'
The doctest module is a lightweight nicety that helps verify that which
is suit
New submission from David M. Beazley :
The result of binascii.crc32() is different on the same input in Python
2.6/3.0. For example:
Python 2.6:
>>> binascii.crc32('Hello')
-137262718
Python 3.0:
>>> binascii.crc32(b'Hello')
4157704578
--
com
David M. Beazley added the comment:
Can someone PLEASE make sure this gets documented someplace.
___
Python tracker
<http://bugs.python.org/issue4903>
___
___
Python-bug
David M. Beazley added the comment:
Placing a note in the standard library documentation would be a start.
Just say in Python 3.0 it always returns the result as an unsigned
integer whereas in Python 2.6 a 32-bit signed integer is returned.
Although the numerical value may differ between
David W. Lambert added the comment:
http://docs.python.org/dev/3.1/library/unittest.html#module-unittest
Search for "cmp". There are two references. I apologize if I
misunderstand issue 1717,
--
title: cmp gone---What's new in 3.1 -> cmp g
David W. Lambert added the comment:
Related, but outside python realm, this error likewise confuses:
$ cat < s.sh
#! invalid path
echo hi
EOF
$ ./s.sh
zsh: no such file or directory: ./s.sh
--
nosy: +LambertDW
___
Python tracker
&l
David W. Lambert added the comment:
(Actual command stream includes chmod +x ./s.sh)
___
Python tracker
<http://bugs.python.org/issue4925>
___
___
Python-bugs-list mailin
David W. Lambert added the comment:
My goodness, that's the starting base sequence to gene 38c, chromosome 4
of the Columbian caldera cricket! But seriously...
1) The relevant part of the doc string is this, and this is how it
should read (your argument being "if doctests prov
David W. Lambert added the comment:
For unittests I recommend two things instead of need for doctest change.
A decoupled strict test to prove that the iterator works, and this class
to publish,
class Tped_use_cases(...):
def test_Marker_iteration(self
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue4994>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5028>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5029>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5032>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
This note is simply a reminder that Antoine's 'from __main__ import *'
solution fails in python3. Also, resolution of this issue probably
could incorporate Issue1397474.
>>> import timeit
>>> timeit.timeit('None'
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5044>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
I disagree. You propose to examine the trees but ignore the forest.
The perspective programmer needs to understand what is a file.
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5
David W. Lambert added the comment:
(prospective, not perspective programmer)
Spelling out the possibilities as suggested in Message80563 makes better
sense to me than writing in words the logic handling the mode argument
of the io.open function. (Perhaps there is a clearer implementation
David W. Lambert added the comment:
Nice. Now I know that $e$ is a least transcendental number. But I
can't figure out why inserting this code into your file (and removing
some "itertools.") is difficult or unreadable. I maintain a personal
library of modules that I don
David W. Lambert added the comment:
Probably a better prime factor algorithm uses Sieve of E. to generate
primes through int(1+sqrt(n)) and test these.
The other algorithm uses a custom generator anyway. Oh well, good luck,
I'll shut up.
You do have use cases that I couldn't think
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue1397474>
___
___
Python-bugs-list mailing list
Unsubscribe:
David W. Lambert added the comment:
I'd prefer round(x,positive_integer) return float. Returning int is a
bit of a lie, except that the decimal module is available to avoid this
sort of lie.
For non-positive integer roundings I'd like an integer return.
In my opinion, we'
David W. Lambert added the comment:
The value of one of the arguments controls how many digits there are.
Certainly if you rounded $10 to the nearest cents you'd expect $10.00.
Thus round(10,2) should be 10.00. Without using decimal module, the
best we can do is produce 10.0.
I'
David W. Lambert added the comment:
The del statement makes the variable local, as alluded to by
http://docs.python.org/dev/3.0/reference/simple_stmts.html#the-del-
statement
The manual is clearer about assignments, which are local unless declared
global or nonlocal.
For other question, me
David W. Lambert added the comment:
My second answer is irrelevant. Function receives the global data as
well as the arguments.
___
Python tracker
<http://bugs.python.org/issue5
Changes by David W. Lambert :
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python.org/issue5099>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by David W. Lambert :
___
Python tracker
<http://bugs.python.org/issue4174>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/o
Changes by David W. Lambert :
___
Python tracker
<http://bugs.python.org/issue4174>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/o
David W. Lambert added the comment:
The alternative is unreasonable. I doubt you'd be happy with this:
a = 'Something'
def variable_both_global_and_local()->Exception('No good!'):
del a# delete a from global name space
a = 'anotherthing
David W. Lambert added the comment:
memcpy won't work if the data type changes. (possibly signed <->
unsigned same-byte-count works).
--
nosy: +LambertDW
___
Python tracker
<http://bugs.python
David W. Lambert added the comment:
#Ah! Not a problem. You need globals() and locals() dictionaries.
# as a python3 script, this message produces next couple lines output.
#method one
#yup, global a is gone
#method two
#{'gv': 'local here', 'name': '
David W. Lambert added the comment:
Python 3.0rc1+ (py3k, Nov 5 2008, 14:44:46) [GCC 3.4.6 20060404 (Red
Hat 3.4.6-3)] on linux2 Type "help", "copyright", "credits" or "license"
for more information.
>>> ' '.
4401 - 4500 of 12944 matches
Mail list logo