Re: i use the urllib question

2008-12-07 Thread Gabriel Genellina
En Fri, 05 Dec 2008 10:23:44 -0200, Huytason <[EMAIL PROTECTED]> escribió: i use pthon 3.0 today python code: import urllib.request then use PyRun_StringFlag to run it. get this it's a bug? You should tell us more details. You are embedding Python, I presume? The default search path (sys.

Re: Best way to run multiple Python processes without overloading CPU or disk i/o

2008-12-07 Thread Gabriel Genellina
En Wed, 03 Dec 2008 02:29:32 -0200, Philip Semanchuk <[EMAIL PROTECTED]> escribió: On Dec 2, 2008, at 11:21 PM, [EMAIL PROTECTED] wrote: Is there a cross-platform way to launch multiple Python processes and monitor CPU usage os.getloadavg() might be useful. It certainly works on *nix, don't

Re: getting error...... Traceback (most recent call last): File "", line 1, in File "C:\Python25\Lib\site-packages\xlrd\__init__.py", line 370, in open_workbook biff_version = bk.getbo

2008-12-07 Thread Gabriel Genellina
En Fri, 05 Dec 2008 02:31:01 -0200, pk sahoo <[EMAIL PROTECTED]> escribió: hallo everybody, when i am running the following command import xlrd book=xlrd.open_workbook("C:\\a.xls") i am getting the following error.. *Traceback (most recent call last): File "", line 1, in File "C:\Py

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread Martin v. Löwis
> Should specifying the 3.0 tag implicity and automatically specify the > 3 tag as well? No. There is really no builtin automatic semantics to any of the classifiers. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: Guido's new method definition idea

2008-12-07 Thread Lie Ryan
On Sun, 07 Dec 2008 12:57:27 +0100, News123 wrote: > Lie wrote: >> On Dec 7, 1:02 am, News123 <[EMAIL PROTECTED]> wrote: >>> What would be interesting would be some syntactical sugar to get rid >>> of the 'self' (at least in the code body). >>> >>> example: >>> class C: >>> class_elements a,b,

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
James Stroud wrote: Robert Kern wrote: James Stroud wrote: py> 112 = [1, y] py> y in 112 Traceback (most recent call last): File "", line 1, in ValueError: The truth value of an array with more than one element is... but not py> ll1 = [y,1] py> y in ll1 True It's this discrepancy that see

Re: tabs and spaces in py3k

2008-12-07 Thread inyeol . lee
On Dec 7, 8:51 pm, [EMAIL PROTECTED] wrote: > The following code works under 2.6 > > def foo(): > a = 1 > <.tab..>b = 1 > > but results in a TabError in Python 3k > > File "x.py", line 3 > b = 3 > ^ > TabError: inconsistent use of tabs and spaces in indentation > > T

Re: Guido's new method definition idea

2008-12-07 Thread Lie Ryan
On Sun, 07 Dec 2008 20:56:40 +, I V wrote: > So, if we want Python to the programming language of choice for Lacanian > psychoanalysts, perhaps we should adopt the symbol "$" (or even, with > Python 3's support for unicode identifiers, S followed by U+0388) > instead of "self." Is that suppos

Re: tabs and spaces in py3k

2008-12-07 Thread Lie Ryan
On Sun, 07 Dec 2008 20:51:50 -0800, rurpy wrote: > Do the Py3k docs need correction? If I were the maintainer of the parser, I'd add something like this: tab_width = random.randint(0, 1000) -- http://mail.python.org/mailman/listinfo/python-list

Re: A question about reference in Python.

2008-12-07 Thread James Mills
On Mon, Dec 8, 2008 at 4:25 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > No apology necessary of course, i just didn't want the newbie OP to > pick up any bad Python coding habits. Apologies that I might have > phrased my criticism a bit harshly. No not at all :) I do use class variables in some

Re: A question about reference in Python.

2008-12-07 Thread Chris Rebert
On Sun, Dec 7, 2008 at 10:17 PM, James Mills <[EMAIL PROTECTED]> wrote: > On Mon, Dec 8, 2008 at 4:13 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: >> The following three lines serve no purpose and can only lead to confusion: >>> value = None >>> prev = None >>> next = None > > You are absolute

Re: A question about reference in Python.

2008-12-07 Thread James Mills
On Mon, Dec 8, 2008 at 4:13 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > The following three lines serve no purpose and can only lead to confusion: >> value = None >> prev = None >> next = None You are absolutely right :) Updated code: #!/home/jmills/bin/python -i class Node(object):

Re: A question about reference in Python.

2008-12-07 Thread Chris Rebert
On Sun, Dec 7, 2008 at 10:09 PM, James Mills <[EMAIL PROTECTED]> wrote: > Hi, > > This is really really really pointless code and a really really pointless > exercise, but nonetheless, here is a very very basic and minimal > implementation of what you're expecting. This should almost > *never* be d

Re: A question about reference in Python.

2008-12-07 Thread James Mills
Hi, This is really really really pointless code and a really really pointless exercise, but nonetheless, here is a very very basic and minimal implementation of what you're expecting. This should almost *never* be done in Python! Python is a superior dynamic programming language, but it's NOT C!

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
Robert Kern wrote: James Stroud wrote: py> 112 = [1, y] py> y in 112 Traceback (most recent call last): File "", line 1, in ValueError: The truth value of an array with more than one element is... but not py> ll1 = [y,1] py> y in ll1 True It's this discrepancy that seems like a bug, not th

Re: python book for non technical absolute beginner

2008-12-07 Thread Tom Morris
On 2008-12-06, News123 <[EMAIL PROTECTED]> wrote: > One of my 'non technical' friends complained about knowing nothing at > all about programming (though using computers regularly for mails / web > browsing / googling and downloading / cropping photos ) > > He wants to play a little with programmin

Re: A question about reference in Python.

2008-12-07 Thread Kermit Mei
Chris Rebert wrote: On Sun, Dec 7, 2008 at 9:26 PM, Group <[EMAIL PROTECTED]> wrote: Hello, I'm studying algorithom. For concentrating on the question itself, I intend to use Python to implement the algorithoms. Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can use

Re: A question about reference in Python.

2008-12-07 Thread Chris Rebert
On Sun, Dec 7, 2008 at 9:26 PM, Group <[EMAIL PROTECTED]> wrote: > Hello, I'm studying algorithom. For concentrating on the question itself, I > intend to use Python to implement the algorithoms. > > Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can > use pointers to refe

A question about reference in Python.

2008-12-07 Thread Group
Hello, I'm studying algorithom. For concentrating on the question itself, I intend to use Python to implement the algorithoms. Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can use pointers to refer to children notes (or next notes). But, in Python, how can I do it

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
James Stroud wrote: Robert Kern wrote: James Stroud wrote: I'm missing how a.all() solves the problem Rasmus describes, namely that the order of a python *list* affects the results of containment tests by numpy.array. E.g. "y in ll1" and "y in ll2" evaluate to different results in his example

tabs and spaces in py3k

2008-12-07 Thread rurpy
The following code works under 2.6 def foo(): a = 1 <.tab..>b = 1 but results in a TabError in Python 3k File "x.py", line 3 b = 3 ^ TabError: inconsistent use of tabs and spaces in indentation The py3k docs say the same thing as the 2.6 docs, namely that tabs are

Re: infering the number of args a function takes at runtime

2008-12-07 Thread James Mills
On Mon, Dec 8, 2008 at 2:45 PM, Chris Rebert <[EMAIL PROTECTED]> wrote: > On Sun, Dec 7, 2008 at 8:39 PM, sniffer <[EMAIL PROTECTED]> wrote: >> hi all, >> i am a python newbie, in a project currently doing i need to find out >> the number of arguments that a function takes at runtime.? Is this >> p

Re: infering the number of args a function takes at runtime

2008-12-07 Thread Chris Rebert
On Sun, Dec 7, 2008 at 8:39 PM, sniffer <[EMAIL PROTECTED]> wrote: > hi all, > i am a python newbie, in a project currently doing i need to find out > the number of arguments that a function takes at runtime.? Is this > possible ,if so how do i do this,i ve looked through the python > documentation

infering the number of args a function takes at runtime

2008-12-07 Thread sniffer
hi all, i am a python newbie, in a project currently doing i need to find out the number of arguments that a function takes at runtime.? Is this possible ,if so how do i do this,i ve looked through the python documentation but couldnt find anything.any help will be great TIA -- http://mail.python

Re: how to get a beep, OS independent ?

2008-12-07 Thread [EMAIL PROTECTED]
On Dec 7, 8:34 pm, Joe Strout <[EMAIL PROTECTED]> wrote: > On Dec 7, 2008, at 4:43 PM, Steven D'Aprano wrote: > > > Of course, if you're volunteering to write such a standard system beep > > for Python, I for one would be grateful. > > I am.  But where should I put it?  Assuming we don't want to wa

Re: how to get a beep, OS independent ?

2008-12-07 Thread Grant Edwards
On 2008-12-07, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Sun, 07 Dec 2008 00:40:53 +0100, Stef Mientki wrote: >> >> I want to give a small beep, for windows there's message-beep, >> and there seems to be something like " curses" , but that >> package seems to be totally broken in P2.5 for windo

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread illume
hello, PyOpenGL also has a raw module which includes python bindings closer to the C calls... however mostly you want to use the nicer more pythonic versions of functions. Recent pyopengl 3.x versions have been optimized for speed, including optional C level optimizations. So I imagine they are

Re: Python for kids?

2008-12-07 Thread Benjamin
On Dec 7, 2:13 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I have a 12-year-old son who spends too much time playing Xbox live > and watching silly YouTube videos. I would like to try to get him > interested in programming. Is anyone aware of a good book or website > that addresses this concern, pre

Re: Rich Comparisons Gotcha

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 16:23:59 +, Rasmus Fogh wrote: > Just to keep you from shooting at straw men: > > I would have liked it to be part of the design contract (a convention, > if you like) that > 1) bool(x == y) should return a boolean and never throw an error Can't be done without making b

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
Robert Kern wrote: James Stroud wrote: I'm missing how a.all() solves the problem Rasmus describes, namely that the order of a python *list* affects the results of containment tests by numpy.array. E.g. "y in ll1" and "y in ll2" evaluate to different results in his example. It still seems like

Re: Python for kids?

2008-12-07 Thread Benjamin Kaplan
On Sun, Dec 7, 2008 at 8:10 PM, Luis M. González <[EMAIL PROTECTED]> wrote: > This is a very good advice. > I learned from my own experience in college that trying to learn a > solution to a problem I never had, is wasted time. > The first step is confronting your student with an specific problem,

Re: Infinite hangup when using CGI sys.stdin.read()

2008-12-07 Thread MRAB
[EMAIL PROTECTED] wrote: I maintain a CGI framework named PyTin, and while previously the developer was only allowed to access GET and POST by cgi.FieldStorage. I'm trying to add code to my request gatherer that looks like: 1. request.rawpost = StringIO() # Just normal StringIO 2. request.rawpos

Cambodia TEFL - Gap Year, Travel & Study, Paid Teaching Job - http://www.cambodiatefl.com

2008-12-07 Thread Jobs Teaching English in Asia
Cambodia TEFL - Gap Year, Travel & Study, Paid Teaching Job http://www.cambodiatefl.com -- http://mail.python.org/mailman/listinfo/python-list

Infinite hangup when using CGI sys.stdin.read()

2008-12-07 Thread pacsciadmin
I maintain a CGI framework named PyTin, and while previously the developer was only allowed to access GET and POST by cgi.FieldStorage. I'm trying to add code to my request gatherer that looks like: 1. request.rawpost = StringIO() # Just normal StringIO 2. request.rawpost.write(sys.stdin.read()) 3

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
James Stroud wrote: Steven D'Aprano wrote: On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: Rasmus Fogh wrote: ll1 = [y,1] y in ll1 True ll2 = [1,y] y in ll2 Traceback (most recent call last): File "", line 1, in ValueError: The truth value of an array with more than one elemen

Re: Python for kids?

2008-12-07 Thread bearophileHUGS
Luis M. González: >After he tried hard many approaches to solving the problem with his limited >knowledge,< You may even be surprised to see he/her/hir find a solution without your help :-) Or maybe you will see a different solution, this happens often in math and computer science, even basic on

The story of Christmas.

2008-12-07 Thread David and Joni
Receive the TRUE story of Christmas via e mail, just click on the link. Thank you !! http://app.formassembly.com/forms/view/56128 -- http://mail.python.org/mailman/listinfo/python-list

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread alex23
On Dec 8, 11:23 am, [EMAIL PROTECTED] wrote: > Does pyglet use PyOpenGL as its OpenGL wrapper? If not, any idea why? > Seems like it would be a fairly substantial duplication of effort. Taken from: http://groups.google.com/group/pyglet-users/msg/832b15389fccd28d >> IIRC pyglet tries to minimize d

Re: how to get a beep, OS independent ?

2008-12-07 Thread Joe Strout
On Dec 7, 2008, at 4:43 PM, Steven D'Aprano wrote: Of course, if you're volunteering to write such a standard system beep for Python, I for one would be grateful. I am. But where should I put it? Assuming we don't want to wait for the (understandably) lengthy and contentious process requir

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread excord80
On Dec 7, 8:17 pm, "Patrick Mullen" <[EMAIL PROTECTED]> wrote: > On Sun, Dec 7, 2008 at 4:43 PM,  <[EMAIL PROTECTED]> wrote: > > [snip] > PyOpengl - an opengl wrapper.  Version 2 is written in c, version 3 > instead uses ctypes > Pyglet - an opengl + events/sound/etc wrapper written in ctypes Does

Re: Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread Patrick Mullen
On Sun, Dec 7, 2008 at 4:43 PM, <[EMAIL PROTECTED]> wrote: > Trying to decide which to get started with. Can anyone suggest some > pros and cons to each of them? > > Would PyOpenGL be in the same camp as Pygame and pyglet? Do either of > Pygame or pyglet make use of PyOpenGL behind the scenes? > -

Re: Python for kids?

2008-12-07 Thread Luis M . González
This is a very good advice. I learned from my own experience in college that trying to learn a solution to a problem I never had, is wasted time. The first step is confronting your student with an specific problem, then let him try to find a way to solve it by himself. After he tried hard many appr

Re: Python for kids?

2008-12-07 Thread MRAB
Russ P. wrote: Thanks to everyone who replied. The information was very helpful. Someone might want to consider putting a kids section on python.org (if it doesn't have one already -- I didn't see one). You have a kid. Why don't you? :-) -- http://mail.python.org/mailman/listinfo/python-list

Strengths and weaknesses of Pygame vs. pyglet vs. PyOpenGL?

2008-12-07 Thread excord80
Trying to decide which to get started with. Can anyone suggest some pros and cons to each of them? Would PyOpenGL be in the same camp as Pygame and pyglet? Do either of Pygame or pyglet make use of PyOpenGL behind the scenes? -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
Steven D'Aprano wrote: On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: Rasmus Fogh wrote: ll1 = [y,1] y in ll1 True ll2 = [1,y] y in ll2 Traceback (most recent call last): File "", line 1, in ValueError: The truth value of an array with more than one element is ambiguous. Use a

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
Terry Reedy wrote: Robert Kern wrote: Terry Reedy wrote: Rasmus Fogh wrote: Personally I would like to get these [EMAIL PROTECTED]&* misfeatures removed, What you are calling a misfeature is an absence, not a presence that can be removed. That's not quite true. In what way, pray tell.

Re: Rich Comparisons Gotcha

2008-12-07 Thread George Sakkis
On Dec 7, 6:37 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 07 Dec 2008 23:20:12 +, Steven D'Aprano wrote: > > On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: > > >> Rasmus Fogh wrote: > > >>> Current behaviour is both inconsistent and counterintuitive, as

Re: Python for kids?

2008-12-07 Thread Russ P.
Thanks to everyone who replied. The information was very helpful. Someone might want to consider putting a kids section on python.org (if it doesn't have one already -- I didn't see one). -- http://mail.python.org/mailman/listinfo/python-list

Re: Python for kids?

2008-12-07 Thread Russ P.
On Dec 7, 12:13 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I have a 12-year-old son who spends too much time playing Xbox live > and watching silly YouTube videos. I would like to try to get him > interested in programming. Is anyone aware of a good book or website > that addresses this concern, pr

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread excord80
On Dec 7, 12:21 pm, [EMAIL PROTECTED] wrote: >     Martin>http://pypi.python.org/pypi?:action=browse&c=533 > >     Martin> It seems that some package authors only classify with > >     Martin>   Programming Language :: Python :: 3 > > I did a release for lockfile yesterday which supports 3.0.  I ad

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
Steven D'Aprano wrote: On Sun, 07 Dec 2008 23:20:12 +, Steven D'Aprano wrote: On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: Rasmus Fogh wrote: Current behaviour is both inconsistent and counterintuitive, as these examples show. x = float('NaN') x == x False Blame IEEE for t

Re: Python for kids?

2008-12-07 Thread Rhodri James
On Sun, 07 Dec 2008 20:13:37 -, Russ P. <[EMAIL PROTECTED]> wrote: I have a 12-year-old son who spends too much time playing Xbox live and watching silly YouTube videos. I would like to try to get him interested in programming. Is anyone aware of a good book or website that addresses this co

Re: Rich Comparisons Gotcha

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 13:57:54 -0800, James Stroud wrote: > Rasmus Fogh wrote: >> Current behaviour is both inconsistent and counterintuitive, as these >> examples show. >> > x = float('NaN') > x == x >> False > > Perhaps this should raise an exception? Why on earth would you want checkin

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 11:22:23 -0800, walterbyrd wrote: > IMO: breaking backward compatibility is a big deal, and should only be > done when it is seriously needed. > > Also, IMO, most of, if not all, of the changes being made in 3.0 are > debatable, at best. I can not think of anything that is bei

Re: how to get a beep, OS independent ?

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 12:56:14 -0700, Joe Strout wrote: > On Dec 7, 2008, at 8:48 AM, Grant Edwards wrote: > >> On 2008-12-07, Joe Strout <[EMAIL PROTECTED]> wrote: >> >>> But invoking the standard system beep >> >> What makes you think there is such a thing as "the standard system >> beep"? > > B

Re: how to get a beep, OS independent ?

2008-12-07 Thread D'Arcy J.M. Cain
On Sun, 7 Dec 2008 12:56:14 -0700 Joe Strout <[EMAIL PROTECTED]> wrote: > On Dec 7, 2008, at 8:48 AM, Grant Edwards wrote: > > What makes you think there is such a thing as "the standard system > > beep"? > > Because OS X (the platform with which I'm most familiar) certainly has > one, and REA

Re: Rich Comparisons Gotcha

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 23:20:12 +, Steven D'Aprano wrote: > On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: > >> Rasmus Fogh wrote: >> >>> Current behaviour is both inconsistent and counterintuitive, as these >>> examples show. >>> >> x = float('NaN') >> x == x >>> False >> >>

Re: Re: Rich Comparisons Gotcha

2008-12-07 Thread acerimusdux
James Stroud wrote: Rasmus Fogh wrote: Current behaviour is both inconsistent and counterintuitive, as these examples show. x = float('NaN') x == x False Perhaps this should raise an exception? I think the problem is not with comparisons in general but with the fact that nan is type float:

Re: Don't you just love writing this sort of thing :)

2008-12-07 Thread Rhodri James
On Sun, 07 Dec 2008 07:27:51 -, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: In message <[EMAIL PROTECTED]>, Rhodri James wrote: Yes, it's very pretty, and you're terribly clever. In six months' time when you come back to make some engineering change and have to sit down and break it

Re: Rich Comparisons Gotcha

2008-12-07 Thread Steven D'Aprano
On Sun, 07 Dec 2008 15:32:53 -0600, Robert Kern wrote: > Rasmus Fogh wrote: > >> Current behaviour is both inconsistent and counterintuitive, as these >> examples show. >> > x = float('NaN') > x == x >> False > > Blame IEEE for that one. Rich comparisons have nothing to do with that > o

Re: Mathematica 7 compares to other languages

2008-12-07 Thread Xah Lee
For those interested in this Mathematica problem, i've now cleaned up the essay with additional comments here: • A Mathematica Optimization Problem http://xahlee.org/UnixResource_dir/writ/Mathematica_optimization.html The result and speed up of my code can be verified by anyone who has Mathema

Re: Guido's new method definition idea

2008-12-07 Thread Philip Slate
On Dec 7, 1:13 pm, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > and friendlier to newbies. > > I'd rather say "more acceptable to java-brainwashed developpers". And I'd rather say you're trolling, but that's ok since you're preaching to the converted. You conveniently forgot to mention the

Re: Python 3.0 automatic decoding of UTF16

2008-12-07 Thread John Machin
On Dec 8, 2:05 am, Johannes Bauer <[EMAIL PROTECTED]> wrote: > John Machin schrieb: > > > He did. Ugly stuff using readline() :-) Should still work, though. > > Well, well, I'm a C kinda guy used to while (fgets(b, sizeof(b), f)) > kinda loops :-) > > But, seriously - I find that whole "while True:

Re: Rich Comparisons Gotcha

2008-12-07 Thread Terry Reedy
Rasmus Fogh wrote: Can anybody see a way this could be fixed (please)? I may well have to live with it, but I would really prefer not to. I made a suggestion in my first response, which perhaps you missed. tjr -- http://mail.python.org/mailman/listinfo/python-list

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
James Stroud wrote: [cast to bool] for numpy works like a unary ufunc. Scratch that. Not thinking and typing at same time. -- James Stroud UCLA-DOE Institute for Genomics and Proteomics Box 951570 Los Angeles, CA 90095 http://www.jamesstroud.com -- http://mail.python.org/mailman/listinfo/pyt

Re: Rich Comparisons Gotcha

2008-12-07 Thread Terry Reedy
Robert Kern wrote: Terry Reedy wrote: Rasmus Fogh wrote: Personally I would like to get these [EMAIL PROTECTED]&* misfeatures removed, What you are calling a misfeature is an absence, not a presence that can be removed. That's not quite true. In what way, pray tell. My statement still

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
Rasmus Fogh wrote: Current behaviour is both inconsistent and counterintuitive, as these examples show. x = float('NaN') x == x False Perhaps this should raise an exception? I think the problem is not with comparisons in general but with the fact that nan is type float: py> type(float('Na

Re: Rich Comparisons Gotcha

2008-12-07 Thread James Stroud
Luis Zarrabeitia wrote: Quoting James Stroud <[EMAIL PROTECTED]>: First, here is why the ability to throw an error is a feature: class Apple(object): def __init__(self, appleness): self.appleness = appleness def __cmp__(self, other): assert isinstance(other, Apple), 'must comp

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Tim Rowe
2008/12/7 walterbyrd <[EMAIL PROTECTED]>: > IMO: breaking backward compatibility is a big deal, and should only be > done when it is seriously needed. > > Also, IMO, most of, if not all, of the changes being made in 3.0 are > debatable, at best. I can not think of anything that is being changed > t

Re: Rich Comparisons Gotcha

2008-12-07 Thread Robert Kern
Rasmus Fogh wrote: Current behaviour is both inconsistent and counterintuitive, as these examples show. x = float('NaN') x == x False Blame IEEE for that one. Rich comparisons have nothing to do with that one. ll = [x] x in ll True x == ll[0] False import numpy y = numpy.zeros((3,))

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread nnp
Have a read of this http://www.b-list.org/weblog/2008/dec/05/python-3000/ It's a response to questions similar to yours by James Bennett On Sun, Dec 7, 2008 at 7:22 PM, walterbyrd <[EMAIL PROTECTED]> wrote: > IMO: breaking backward compatibility is a big deal, and should only be > done when it is

Re: how to get a beep, OS independent ?

2008-12-07 Thread Diez B. Roggisch
Peter Pearson schrieb: On Sun, 07 Dec 2008 00:40:53 +0100, Stef Mientki wrote: I want to give a small beep, for windows there's message-beep, and there seems to be something like " curses" , but that package seems to be totally broken in P2.5 for windows. Any other suggestions ? Many people h

Re: how to get a beep, OS independent ?

2008-12-07 Thread Peter Pearson
On Sun, 07 Dec 2008 00:40:53 +0100, Stef Mientki wrote: > > I want to give a small beep, > for windows there's message-beep, > and there seems to be something like " curses" , > but that package seems to be totally broken in P2.5 for windows. > > Any other suggestions ? Many people have suggested

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
On Sun, 07 Dec 2008 20:56:40 GMT I V <[EMAIL PROTECTED]> wrote: > So, if we want Python to the programming language of choice for > Lacanian psychoanalysts, perhaps we should adopt the symbol "$" (or > even, with Python 3's support for unicode identifiers, S followed by > U+0388) instead of "self."

Re: Guido's new method definition idea

2008-12-07 Thread I V
On Sat, 06 Dec 2008 16:34:56 -0800, Erik Max Francis wrote: > `$` as a shortcut for self, on the other hand, gives absolutely no > mnemonic indication what it stands for, and users would be simply left > guessing. However, $ is sometimes used as an alternative way of writing S̸ (I've attempted to

Re: Python for kids?

2008-12-07 Thread André
On Dec 7, 4:13 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I have a 12-year-old son who spends too much time playing Xbox live > and watching silly YouTube videos. I would like to try to get him > interested in programming. Is anyone aware of a good book or website > that addresses this concern, pre

Re: Python for kids?

2008-12-07 Thread bearophileHUGS
On Dec 7, 9:13 pm, "Russ P." <[EMAIL PROTECTED]> wrote: > I have a 12-year-old son who spends too much time playing Xbox live > and watching silly YouTube videos. I would like to try to get him > interested in programming. Lot of people learn to program even before age of 12. But I think it's bett

Re: Source code generation using Python

2008-12-07 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 ats wrote: > I want to generate 3 different versions of a C++ source code, > basically injecting different flavours of inline assembler depending > on target compiler/CPU. Are you aware that there are also packages that let you generate and call C cod

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread bearophileHUGS
walterbyrd: > I can not think of anything that is being changed that was really a "show > stopper" anyway.< I agree, but Python and its culture has a characteristic that not many other languages share: it tries to be a tidy language, to have one obvious way to do most things, it values readabilit

Re: Python for kids?

2008-12-07 Thread Andreas Waldenburger
On Sun, 7 Dec 2008 12:13:37 -0800 (PST) "Russ P." <[EMAIL PROTECTED]> wrote: > I have a 12-year-old son who spends too much time playing Xbox live > and watching silly YouTube videos. I would like to try to get him > interested in programming. Is anyone aware of a good book or website > that addre

Re: Python for kids?

2008-12-07 Thread Brian Blais
On Dec 7, 2008, at 15:13 , Russ P. wrote: I have a 12-year-old son who spends too much time playing Xbox live and watching silly YouTube videos. I would like to try to get him interested in programming. Is anyone aware of a good book or website check out: http://www.briggs.net.nz/log/writin

Re: Guido's new method definition idea

2008-12-07 Thread Brian Blais
On Dec 5, 2008, at 21:21 , Daniel Fetchinson wrote: The proposal is to allow this: class C: def self.method( arg ): self.value = arg return self.value instead of this: class C: def method( self, arg ): self.value = arg return self.value I have never

Python for kids?

2008-12-07 Thread Russ P.
I have a 12-year-old son who spends too much time playing Xbox live and watching silly YouTube videos. I would like to try to get him interested in programming. Is anyone aware of a good book or website that addresses this concern, preferably (but not necessarily) using Python? I could try to teach

Re: [OT] [sort of] Malcom Reynolds?

2008-12-07 Thread Aahz
In article <[EMAIL PROTECTED]>, Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > >Just found this in the re module's docs: > >m = re.match(r"(?P\w+) (?P\w+)", "Malcom >Reynolds") > >Does this represent an attempt to phase out the gratuitous Monty Python >references in favor of gratuitous

Re: Guido's new method definition idea

2008-12-07 Thread Antoine De Groote
Bruno Desthuilliers wrote: > Daniel Fetchinson a écrit : > (snip) >> It doesn't add anything but makes something that exists a bit clearer > > Err... I fail to see how magically transforming def self.foo(...) into > def foo(self, ...) makes anything clearer about what really happens and > how Py

Re: Brain going crazy with recursive functions

2008-12-07 Thread Lie Ryan
On Sat, 06 Dec 2008 23:33:35 -0800, 5lvqbwl02 wrote: > I'm trying to solve the 9-tile puzzle using as functional an approach as > possible. I've recently finished reading SICP and am deliberately > avoiding easy python-isms for the more convoluted scheme/functional > methods. The following funct

[OT] [sort of] Malcom Reynolds?

2008-12-07 Thread Andreas Waldenburger
Just found this in the re module's docs: m = re.match(r"(?P\w+) (?P\w+)", "Malcom Reynolds") Does this represent an attempt to phase out the gratuitous Monty Python references in favor of gratuitous Firefly references? Because if so, I'm all for it. Anyways, stuff like that really makes

Re: how to get a beep, OS independent ?

2008-12-07 Thread Joe Strout
On Dec 7, 2008, at 8:48 AM, Grant Edwards wrote: On 2008-12-07, Joe Strout <[EMAIL PROTECTED]> wrote: But invoking the standard system beep What makes you think there is such a thing as "the standard system beep"? Because OS X (the platform with which I'm most familiar) certainly has o

Re: Number of Python 3.x packages at the PyPI

2008-12-07 Thread Martin v. Löwis
> I've had to fork my appscript project's codebase in order to add > support for Python 3.x. I would like to distribute both 2.x and 3.x > versions under the same package name for obvious reasons. This isn't a > problem with eggs as the Python version number is included in each > egg's name, but wh

Re: Guido's new method definition idea

2008-12-07 Thread Bruno Desthuilliers
Daniel Fetchinson a écrit : (snip) Still, improved error messages would be desirable (concerning the number of arguments passed to an instance method). Then count me as +2 on this !-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Importing the re module fails

2008-12-07 Thread Andreas Waldenburger
On Sun, 07 Dec 2008 20:36:58 +0100 "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > Andreas Waldenburger schrieb: > > This is a little puzzling. > > > > > > Using ipython: > > > > [EMAIL PROTECTED] Logstuff]$ ipython > > Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) > > Type "cop

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Andreas Waldenburger
On Sun, 7 Dec 2008 20:35:53 +0100 Andreas Waldenburger <[EMAIL PROTECTED]> wrote: > On Sun, 7 Dec 2008 11:22:23 -0800 (PST) walterbyrd > <[EMAIL PROTECTED]> wrote: > > > At best, I am a casual python user, so it's likely that I am missing > > something. > Yes, the big picture. > OK, that was a b

Re: Importing the re module fails

2008-12-07 Thread Diez B. Roggisch
Andreas Waldenburger schrieb: This is a little puzzling. Using ipython: [EMAIL PROTECTED] Logstuff]$ ipython Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) Type "copyright", "credits" or "license" for more information. [snip ipython help message] In [1]: import re

Re: Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread Andreas Waldenburger
On Sun, 7 Dec 2008 11:22:23 -0800 (PST) walterbyrd <[EMAIL PROTECTED]> wrote: > IMO: breaking backward compatibility is a big deal, and should only be > done when it is seriously needed. > Plze. Python 3 is shipping now, and so is 2.x, where x > 5. Python 2 is going to be around for quite som

Re: Guido's new method definition idea

2008-12-07 Thread Daniel Fetchinson
The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future version of python is a possibility sin

Importing the re module fails

2008-12-07 Thread Andreas Waldenburger
This is a little puzzling. Using ipython: [EMAIL PROTECTED] Logstuff]$ ipython Python 2.5.2 (r252:60911, Sep 30 2008, 15:41:38) Type "copyright", "credits" or "license" for more information. [snip ipython help message] In [1]: import re This works fine. But with the

Re: Guido's new method definition idea

2008-12-07 Thread Bruno Desthuilliers
Daniel Fetchinson a écrit : Hi folks, The story of the explicit self in method definitions has been discussed to death and we all know it will stay. However, Guido himself acknowledged that an alternative syntax makes perfect sense and having both (old and new) in a future version of python is a

Is 3.0 worth breaking backward compatibility?

2008-12-07 Thread walterbyrd
IMO: breaking backward compatibility is a big deal, and should only be done when it is seriously needed. Also, IMO, most of, if not all, of the changes being made in 3.0 are debatable, at best. I can not think of anything that is being changed that was really a "show stopper" anyway. At best, I a

Re: Guido's new method definition idea

2008-12-07 Thread Bruno Desthuilliers
News123 a écrit : Lie wrote: On Dec 7, 1:02 am, News123 <[EMAIL PROTECTED]> wrote: What would be interesting would be some syntactical sugar to get rid of the 'self' (at least in the code body). This has been debated to hell and back. And it's *not* going to happen. example: class C: cl

Re: Guido's new method definition idea

2008-12-07 Thread Andreas Waldenburger
On Sun, 07 Dec 2008 19:13:18 +0100 Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > > and friendlier to newbies. > > I'd rather say "more acceptable to java-brainwashed developpers". Why would you rather be unfriendly and seed ambivalence? I do see the fun in a little Python snobbism, but ... c

  1   2   >