On Mon, 22 Sep 2008 07:35:50 -0700, bearophileHUGS wrote:
Tino Wildenhain:
Wouldn't
len([x for x in iterable if x==y])
or even shorter:
iterable.count(y)
not work and read better anyway?
The first version creates an actual list just to take its length, think
about how much memory it
Grzegorz Staniak wrote:
On 22.09.2008, Carl Banks [EMAIL PROTECTED] wroted:
Some would argue (and some did by the time Python grew a 'bool' type)
that what is wrong is to have a bool type in a language that already
have a wider definition of the truth value of an expression...
And some would
On Sep 22, 11:46 pm, Aaron \Castironpi\ Brady
[EMAIL PROTECTED] wrote:
On Sep 22, 5:32 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote:
On 22 Sep 2008 09:07:43 GMT, Steven D'Aprano
But that's precisely what I want
On Sep 22, 6:55 pm, MRAB [EMAIL PROTECTED] wrote:
On Sep 22, 11:46 pm, Aaron \Castironpi\ Brady
[EMAIL PROTECTED] wrote:
On Sep 22, 5:32 pm, Steven D'Aprano [EMAIL PROTECTED]
cybersource.com.au wrote:
On Mon, 22 Sep 2008 19:41:46 +1000, James Mills wrote:
On 22 Sep 2008 09:07:43
On Sep 22, 5:59 pm, Robocop [EMAIL PROTECTED] wrote:
I also forgot to mention that it need not be nearly as robust as
something like Jailhelper 2.0, I will not really need to compensate
for noise and irregular conditions. All of my barcodes will be
scanned in a predictable, and consistent
On Sep 22, 11:07 pm, [EMAIL PROTECTED] wrote:
On Sep 22, 5:52 pm, Matimus [EMAIL PROTECTED] wrote:
On Sep 22, 2:31 pm, [EMAIL PROTECTED] wrote:
hi all,
forgive me , but the RTFM and Google search approaches are not
yielding an answer on this question. I need to know if there's a
Why doesn't Python optimize tailcalls? Are there plans for it?
I know GvR dislikes some of the functional additions like reduce and
Python is supposedly about one preferrable way of doing things but
not being able to use recursion properly is just a big pain in the
a**.
--
Snce when are users ever involved
in programming problems or programming
languages ?
since the begining, the first users are programmers, users of your
libraries.
--
http://mail.python.org/mailman/listinfo/python-list
On Sep 22, 8:13 pm, process [EMAIL PROTECTED] wrote:
Why doesn't Python optimize tailcalls? Are there plans for it?
I know GvR dislikes some of the functional additions like reduce and
Python is supposedly about one preferrable way of doing things but
not being able to use recursion properly
It is clear to me that Python is a multiparadigmed object oriented
language. It is clearly possible to write procedural code... that is,
Python does not force object oriented syntax or concepts on you and
insist you define everything in such a structure. Is the OO it allows
full OO, I think so,
To All,
I was wondering if anyone has come across the issue of not being allowed
to have the following within a Python script operating under Linux:
time.sleep(0.0125)
It appears that I am not allowed to have the object sleep. Has anyone
encountered this specific issue before in the past?
Steven D'Aprano:
I'm sorry, I don't recognise leniter(). Did I miss something?
I have removed the docstring/doctests:
def leniter(iterator):
if hasattr(iterator, __len__):
return len(iterator)
nelements = 0
for _ in iterator:
nelements += 1
return nelements
it
On Sep 22, 9:13 pm, process [EMAIL PROTECTED] wrote:
Why doesn't Python optimize tailcalls? Are there plans for it?
I know GvR dislikes some of the functional additions like reduce and
Python is supposedly about one preferrable way of doing things but
not being able to use recursion properly
Steven D'Aprano:
For many iterables, the amount of memory is not excessive and the increase in
readability of len() is to be preferred over the side-effect of sum(1 for...).
With side-effects do you mean the possibility of exhausting a lazy
iterable?
The readability difference is little, and
I'm relatively new to python. I'm following a tutorial I found on the
net, and it uses scipy's gplt for plotting.
I installed scipy from their website (win32 installation), numpy also,
but when I do
from scipy import gplt
it gives this error:
Traceback (most recent call last):
File pyshell#0,
I have a PyObject, say 'Hello World' , a string,
How do I convert it to a string in C++?
Thanks in advance!
--
http://mail.python.org/mailman/listinfo/python-list
PyString_AsString returns a c string. Just feed it to std::string
http://docs.python.org/api/stringObjects.html#l2h-472
On Tue, Sep 23, 2008 at 11:32 AM, [EMAIL PROTECTED] wrote:
I have a PyObject, say 'Hello World' , a string,
How do I convert it to a string in C++?
Thanks in advance!
--
On Sep 22, 9:32 pm, [EMAIL PROTECTED] wrote:
I have a PyObject, say 'Hello World' , a string,
How do I convert it to a string in C++?
Thanks in advance!
Look at PyString_AsStringAndSize . It gives you a pointer to a buffer
and a size. Allocate a new one and copy it if you need to modify it,
On 2008-09-23, Blubaugh, David A. [EMAIL PROTECTED] wrote:
I was wondering if anyone has come across the issue of not being allowed
to have the following within a Python script operating under Linux:
time.sleep(0.0125)
No, I have not. And I doubt anybody else has.
It appears that I am
[EMAIL PROTECTED] wrote:
On Sep 19, 6:42 pm, [EMAIL PROTECTED] wrote:
On Sep 19, 1:24 am, Tim Roberts [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
I tried curses.setsyx(2,3) in my script and it doesn't move the curses
cursor. Any alternatives/solutions?
Did you call doupdate
For many external lib, python( and www.freebasic.net) use only the DLL
version, whcih is very big often if we want to release our program.
So, is there such a tool that can scan a DLL then strip the unused
function's code out, so yields a small working DLL?
for example, in my program I use only
(From: http://paddy3118.blogspot.com/2008/09/python-fractions-issue.html)
There seems to be a problem/difference in calculating with the new
fractions module when comparing Python 26rc2 and 30rc1
I was reading the paper Interval Arithmetic: Python Implementation
and Applications and thought to
Tim Leslie wrote:
There is no need for a wrapper. Both numarray and Numeric have been
deprecated in favour of numpy.
Well, some years ago I looked for a matrix package. At that time it looked
that numarray was the end of it all - it had a clean syntax, an active
developer team. It looked to
Greetings,
I want to have a class as a container for a bunch of symbolic names
for integers, eg:
class Constants:
FOO = 1
BAR = 2
Except that I would like to attach a docstring text to the constants,
so that help(Constants.FOO) will print some arbitrary string. Sort of
a very limited
Gerhard Häring [EMAIL PROTECTED] added the comment:
Thanks a lot, Benjamin!
Committed revision 66550.
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3659
Dominique Wahli [EMAIL PROTECTED] added the comment:
I hope this bug will have some attention before final 2.6
Work on Python 2.5.2 and not on 2.6rc1 and 2.6rc2
--
title: Tix ComboBox error - Python 2.6rc2: Tix ComboBox error
___
Python tracker
Winfried Plappert [EMAIL PROTECTED] added the comment:
Hi Georg,
whatever I am getting when I am doing a make latex in the Docs
directory. The current version is 66550: Sphinx v0.5, building latex.
I just redid it again and the error persists. But you say that one has
to use unreleased SVN
T.Morin [EMAIL PROTECTED] added the comment:
Exercising the API fully requires an SSM capable multicast LAN.
... and it also requires a host IP stack implementing the API, which is
not yet (AFAIK) the case for Mac OS X, even very recent releases.
I think you will need a Windows or Linux box
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Tix is still at version 8.4 (tix84.dll) when tcl has been upgraded to
8.5 (tcl85.dll and tk85.dll)
The Tix project does not seem to be maintained any more.
I managed to recompile it against tcl85, but nothing changed.
Should we remove
New submission from Erik Sandberg [EMAIL PROTECTED]:
When building Python on Solaris, I don't get the os.mknod function. This
seems to be a combination of two errors:
1. The definition of posix_mknod() in posixmodule.c is surrounded by:
#if defined(HAVE_MKNOD) defined(HAVE_MAKEDEV)
It works
New submission from Hagen Fürstenau [EMAIL PROTECTED]:
Opening a dbm database which doesn't exist without a c or n flag
results in this exception:
import dbm
dbm.open(abc)
Traceback (most recent call last):
File stdin, line 1, in module
File
New submission from Mark Summerfield [EMAIL PROTECTED]:
Py30rc1
On Windows the file object returned by urllib.request.urlopen() appears
to be in binary mode, so .read() returns a bytes object. But on Linux it
appears to be in text mode, so .read() returns a str object. It seeems
to me that the
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
dbm.error is documented as a tuple, and I'd prefer not to change this:
http://docs.python.org/dev/3.0/library/dbm.html#dbm.error
Since it says that its first member is another dbm.error exception,
we could simply raise error[0](message)
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
I only get bytes on Linux. Do you have a test script?
--
nosy: +amaury.forgeotdarc
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3930
___
Jeffrey C. Jacobs [EMAIL PROTECTED] added the comment:
I think Mike Coleman proposal of enabling this behaviour via flag is
probably best and IMHO we should consider it under these circumstances.
Intuitively, I think you're interpretation of what re.split should do
under zero-width conditions
Mark Summerfield [EMAIL PROTECTED] added the comment:
Sorry, I now can't reproduce it. I made a tiny test script and it worked
fine on both Windows and Linux. Now when I run the real test that works
fine too. So could you close/remove this bug for me please?
#!/usr/bin/env python3
import sys
New submission from Maciek Fijalkowski [EMAIL PROTECTED]:
Although it doesn't start with _ and is definitely necessary as codecs
call it.
--
components: Library (Lib)
messages: 73569
nosy: fijal
severity: normal
status: open
title: codecs.charmap_build is untested and undocumented
type:
Changes by Amaury Forgeot d'Arc [EMAIL PROTECTED]:
--
resolution: - invalid
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3930
___
Changes by Hirokazu Yamamoto [EMAIL PROTECTED]:
Removed file:
http://bugs.python.org/file11455/experimental_mbcstowcs_codec.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3824
___
Georg Brandl [EMAIL PROTECTED] added the comment:
Amaury's patch looks good.
--
nosy: +georg.brandl
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3929
___
New submission from yanne [EMAIL PROTECTED]:
It seems that HTMLParser.feed throws an exception whenever an attribute
name contains both quotation mark '' and non-ascii characters.
Running the attached test file with Python 2.5 succeeds, but with Python
2.6, the result is:
C:\Python26python.exe
New submission from Jean-Paul Calderone [EMAIL PROTECTED]:
[EMAIL PROTECTED]:~$ ls .pythonstartup.py
.pythonstartup.py
[EMAIL PROTECTED]:~$ python
Python 2.5.2 (r252:60911, Jul 31 2008, 17:28:52)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type help, copyright, credits or license for more
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
Someone took the time machine and corrected this 18 months ago: r54189
is included in the 2.6 version.
--
nosy: +amaury.forgeotdarc
resolution: - out of date
status: open - closed
___
Python
Jesse Noller [EMAIL PROTECTED] added the comment:
The patch looks fine to me Ben, if you want to apply it.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3927
___
Kirill Simonov [EMAIL PROTECTED] added the comment:
Thank you for the fix, I really appeciate it.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3884
___
___
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
I was not there, but the usual rules state that a backport is not
allowed to break working code, even if it relies on undocumented
features or side-effects.
Here, PyRun_SimpleFileExFlags changed its behaviour: it now deletes
Jean-Paul Calderone [EMAIL PROTECTED] added the comment:
Any buggy behavior might be relied on by applications. Taken to the
extreme, you can never have a bug-fix release of Python.
__file__ from PYTHONSTARTUP breaks the warnings module. It would be
difficult for an application to rely on
Amaury Forgeot d'Arc [EMAIL PROTECTED] added the comment:
I was thinking about an application that embeds an interpreter, and
calls PyRun_SimpleFile(). There are many ways to use python...
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3933
Hirokazu Yamamoto [EMAIL PROTECTED] added the comment:
I'm not cygwin user, but cygwin seems not to support multibyte function.
Following program outputs 5 on VC6 as expected, but 10 on cygwin.
Hmm...
#include stdio.h
#include stdlib.h
#include locale.h
int main(int argc, char* argv[])
{
Guilherme Polo [EMAIL PROTECTED] added the comment:
The first part was already mentioned in issue3391, but not closing this
in favor of the second part of your message.
--
nosy: +gpolo
___
Python tracker [EMAIL PROTECTED]
Andrew I MacIntyre [EMAIL PROTECTED] added the comment:
Committed in revs 66552, 66553 and 66554.
I've blocked r66554 from py3k as other changes are needed for OS/2 (r66555)
I've merged r66552 and r66553 into py3k as they apply cleanly (r66556).
Thanks for the review Amaury.
--
Matthew Barnett [EMAIL PROTECTED] added the comment:
regex_2.6rc2+4.diff fixes the ordering of the capture groups for reverse
searching.
Added file: http://bugs.python.org/file11558/regex_2.6rc2+4.diff
___
Python tracker [EMAIL PROTECTED]
Changes by Matthew Barnett [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11558/regex_2.6rc2+4.diff
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3825
___
Matthew Barnett [EMAIL PROTECTED] added the comment:
Correction of regex_2.6rc2+4.diff. (Aargh!)
Added file: http://bugs.python.org/file11559/regex_2.6rc2+4.diff
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3825
STINNER Victor [EMAIL PROTECTED] added the comment:
I don't understand the problem. If you open a lot of files, the open()
loop will stop an exception (IOError: too many open files), and so
subprocess is not used.
If I open limit-1 files, subprocess._get_handles() will fail on
os.pipe().
If
Mattias Engdegård [EMAIL PROTECTED] added the comment:
As the comment in the original bug report said, you need to raise the
file descriptor limit to something well above 2000 before running the
test case.
Needless to say, you may need to do that part as root in case that would
exceed your hard
Changes by STINNER Victor [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11172/rlock.patch
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3001
___
New submission from robwolfe [EMAIL PROTECTED]:
I've tried to build muppy (http://packages.python.org/muppy/)
documentation on:
$ python2.5 -c import sys; print sys.version
2.5 (release25-maint, Dec 9 2006, 14:35:53)
[GCC 4.1.2 20061115 (prerelease) (Debian 4.1.1-20)]
with Sphinx (version
Matthew Barnett [EMAIL PROTECTED] added the comment:
Implemented in #2636 and #3825.
--
nosy: +mrabarnett
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue433031
___
New submission from jason kirtland [EMAIL PROTECTED]:
The C implementation (only) of bisect does not invoke list subclass
methods when insorting. Code like this will not trigger the assert:
class Boom(list):
def insert(self, index, item):
assert False
bisect.insort(Boom(),
Changes by Skip Montanaro [EMAIL PROTECTED]:
Removed file: http://bugs.python.org/file11517/atexit.diff
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3666
___
Skip Montanaro [EMAIL PROTECTED] added the comment:
I've taken this ticket. Can someone please review and give
it a thumbs up or thumbs down?
--
assignee: - skip.montanaro
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3666
Christian Heimes [EMAIL PROTECTED] added the comment:
*thumbs up*
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3666
___
___
Python-bugs-list mailing list
Guido van Rossum [EMAIL PROTECTED] added the comment:
The problem with doing this per 3.0 is that it's impossible to write a
conversion script.
I'm okay with adding a flag to enable this behavior though. Please open
a new bug with a new patch, preferably one that applies cleanly to the
trunk,
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Dominique, unless you contribute a fix yourself, no fix might get
included in 2.6.
I still would leave Tix in 2.6, unless it can be shown that all Tix
widgets are broken.
I don't think it's a problem that the Tix version is 8.4 - there is no
Nick Coghlan [EMAIL PROTECTED] added the comment:
Patch comments:
- the test suite section of the diff appears to have a number of changes
that are unrelated to this issue
- the purpose of the new do_not_close flag (i.e. avoiding the crash)
could use a comment at the point where it is referenced
Martin v. Löwis [EMAIL PROTECTED] added the comment:
It would be best if you could contribute a patch to fix this. The source
of configure is configure.in; you need autoconf to generate configure
from it.
--
nosy: +loewis
___
Python tracker [EMAIL
Benjamin Peterson [EMAIL PROTECTED] added the comment:
Fixed in r66557.
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3927
___
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Jean-Paul, to find out why the specific patch was not backported, you
would have to ask the original committer (which happens to be Georg
Brandl). If you want to ask that question through the tracker, it's best
to add him to the nosy list, so
Martin v. Löwis [EMAIL PROTECTED] added the comment:
In this case, I think there is nothing we can do. Perhaps it is useful
to put a comment into the test, pointing out that this is likely to
break on Cygwin, and refer to this issue.
I don't see that as a problem: it's just a test that fails,
Changes by Martin v. Löwis [EMAIL PROTECTED]:
--
nosy: +schuppenies
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3934
___
___
Python-bugs-list mailing
Georg Brandl [EMAIL PROTECTED] added the comment:
Closing this one then.
--
nosy: +georg.brandl
resolution: - duplicate
status: open - closed
superseder: - Regexp 2.7 (modifications to current re 2.2.2)
___
Python tracker [EMAIL PROTECTED]
New submission from Terry J. Reedy [EMAIL PROTECTED]:
Copied from c.l.p post by F. Lundh
I have no idea if this has implications for warnings in 2.6
from sympy.mpmath import specfun
So what could be suppressing the warning?
[about 'as' becoming a keyword, when
New submission from Zooko O'Whielacronx [EMAIL PROTECTED]:
platform.dist() returns ('debian', 'lenny/sid', '') on my Ubuntu 8.04
Hardy system. Investigating shows that there are a few techniques in
platform.py to parse the version-number-files of different Linux
distributions. This patch adds
Jesús Cea Avión [EMAIL PROTECTED] added the comment:
Nick:
1. Yes, the code actually patches an unrelated regression too
(DB.verify() crashes). I added the testcase, since the testsuite didn't
exercise DB.verify() and so the bug was lurking there for months. It
is solved now, and the testcase
New submission from Terry J. Reedy [EMAIL PROTECTED]:
Interpreter:
globals()
{'__builtins__': module 'builtins' (built-in), '__name__': '__main__',
'__doc__': None, '__package__': None}
globals().clear()
globals()
Traceback (most recent call last):
File stdin, line 1, in module
NameError:
Zooko O'Whielacronx [EMAIL PROTECTED] added the comment:
Here's a new version of this patch which differs only in having slightly
more correct documentation.
Added file: http://bugs.python.org/file11563/dist.patch.txt
___
Python tracker [EMAIL PROTECTED]
Changes by Martin v. Löwis [EMAIL PROTECTED]:
--
priority: - low
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3938
___
___
Python-bugs-list mailing
New submission from Giampaolo Rodola' [EMAIL PROTECTED]:
ftplib module is currently lacking a test suite which actually connects
to a FTP server and uses the FTP class methods and facilities.
Bug #3911, discovered just a bunch of weeks before the stable release of
Python 3.0, is an example of
Giampaolo Rodola' [EMAIL PROTECTED] added the comment:
Would you like to contribute a patch?
Done in issue #3939.
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3911
___
New submission from Gregor Lingl [EMAIL PROTECTED]:
Thorough testing revealesd the following bugs in turtle.py (Python 2.6):
1) Around lines 359 and 379: There's a name conflict with a methodname
of the parentclass Frame: _root. The bugfix consists in renaming this
attribute, which occurs only
Gregor Lingl [EMAIL PROTECTED] added the comment:
The bugfix for bug 3) described above makes necessary the insertion of a
line in turtleDemo.py (around line 96)
Again I've attached the corresponding diff file
Added file: http://bugs.python.org/file11566/turtleDemo.diff
New submission from Gregor Lingl [EMAIL PROTECTED]:
From IDLE either pressing F1 or choosing the menu Help-Python Docs
should open a Help-Window with the docs of the current version. (This
works well for instance in Python 2.5.2) The docs file normally resides
on the local computer in the Doc
Skip Montanaro [EMAIL PROTECTED] added the comment:
Checked in as revision 66562.
--
resolution: - fixed
status: open - closed
___
Python tracker [EMAIL PROTECTED]
http://bugs.python.org/issue3666
___
New submission from Martin Meredith [EMAIL PROTECTED]:
Recently, a blind user posted on Stack Overflow asking whether there was
something that would allow them to use braces within python.
They have a point, with only tabs being show in the editor, it can be
very confusing for a blind user
New submission from Robert Yodlowski [EMAIL PROTECTED]:
I installed 3.0rc1 on a Win XP 2.4Gzh system with all current updates
with no problems. Cmd line Python and docs work fine.
Tried to start IDLE but got error message: IDLE's subprocess didn't
make connection. Either IDLE can't start
Senthil [EMAIL PROTECTED] added the comment:
Hello Mez, I don't think this will be implemented in the language. There
have discussions on supporting braces (as accessibility mechanism)
before, but it is not generally agreed upon.
I would like to point to you the discussion between Guido and
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Please submit separate patches for unrelated issues. As a whole, the
patch is unacceptable because of that.
Please don't add comments to the code that describe what has changed, or
what was before. Only describe what is. Specifically, don't
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Notice that the chm file is available on Windows only. So in general,
opening the online documentation might be the right thing to do.
--
nosy: +loewis
title: Help in IDLE doesn't work correctly - Help in IDLE should open the chm
Martin v. Löwis [EMAIL PROTECTED] added the comment:
Kurt, even if using online documentation is necessary, I think the URL
is not quite right - it should rather be a version-dependent URL, IMO.
--
assignee: - kbk
nosy: +kbk
___
Python tracker
101 - 190 of 190 matches
Mail list logo