Re: Not fully OO ?

2008-09-21 Thread MVP
Hi! Everything ... are an object. It's true ; but a language built around the objects, and OOP, are two different concepts. @-salutations -- Michel Claveau -- http://mail.python.org/mailman/listinfo/python-list

Re: Not fully OO ?

2008-09-21 Thread M�ta-MCI (MVP)
Bonjour ! AMHA, ceux qui ont écrit ce texte ont une mauvaise idée de ce que sont les variables en Python. Ils ont sans doute trop en tête les notions des variables en C ou en Basic, et ne se sont pas penchés sur les spécificités de Python. @-salutations -- Michel Claveau -- http://mail

Re: Not fully OO ?

2008-09-21 Thread Martin v. Löwis
Christian Heimes wrote: > Kay Schluehr wrote: >> Actually it is simply wrong in the mentioned case [...] > > It's not wrong. You have found a simple optimization. Lot's of compilers > for lots of languages optimize code by code folding. I don't think he meant that Python is wrong somehow, but th

Re: Not fully OO ?

2008-09-21 Thread Fredrik Lundh
Martin v. Löwis wrote: I don't think he meant that Python is wrong somehow, but that the OO babble of what happens for 2+2 is wrong. The babble said that, when the code is executed, an __add__ message is sent to the 2 object, with another 2 object as the parameter. That statement is incorrect:

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-21 Thread Fredrik Lundh
Mensanator wrote: I'm not the one who wrote sympy, so I guess I'm not the only one who didn't notice it. If it's a well known problem, then sorry I wasted your time. Given that 2.5 explicitly warns about this specific change: >>> as = 1 :1: Warning: 'as' will become a reserved keyword in Pyt

Re: report a BUG of package setuptools-0.6c8.

2008-09-21 Thread Sebastien Douche
2008/9/20 Carl Banks <[EMAIL PROTECTED]>: > On Sep 20, 1:11 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> 为爱而生 wrote: >> > File "/usr/lib/python2.5/site-packages/setuptools/command/sdist.py", >> > line 98, in entries_finder >> > log.warn("unrecognized .svn/entries format in %s", dirname) >>

How to kill threading.Thread instance?

2008-09-21 Thread dmitrey
hi all, Is there a better way to kill threading.Thread (running) instance than this one http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496960 (it's all I have found via google). BTW, it should be noticed that lots of threading module methods have no docstrings (in my Python 2.5), for exam

Re: How to kill threading.Thread instance?

2008-09-21 Thread Diez B. Roggisch
dmitrey schrieb: hi all, Is there a better way to kill threading.Thread (running) instance than this one http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496960 (it's all I have found via google). Nope. There might be other ways technically, but none of them falls into a "better"-class

Re: writeable buffer and struct.pack_into and struct.unpck_from

2008-09-21 Thread John Machin
On Sep 21, 3:16 pm, Tzury Bar Yochay <[EMAIL PROTECTED]> wrote: > Thanks Gabriel, > I was missing the information how to create a writable buffer. array.array objects also have the writable buffer nature: >>> import array >>> b = array.array('c', '\0' * 10) >>> b array('c', '\x00\x00\x00\x00\x00\

Re: How to kill threading.Thread instance?

2008-09-21 Thread Fredrik Lundh
dmitrey wrote: BTW, it should be noticed that lots of threading module methods have no docstrings (in my Python 2.5), for example _Thread__bootstrap, _Thread__stop. things named _Class__name are explicitly marked private by the implementation (using the "__" prefix). using them just because

understanding list scope

2008-09-21 Thread Alex
Hi all! I have a problem understanding the behaviour of this snippet: data_set = ({"param":"a"},{"param":"b"},{"param":"c"}) for i in range(len(data_set)): ds = data_set[:] data = ds[i] if i == 1: data['param'] = "y" if i == 2: data['param'] = "x" print data_set This script pr

Re: understanding list scope

2008-09-21 Thread George Sakkis
On Sep 21, 8:51 am, Alex <[EMAIL PROTECTED]> wrote: > Hi all! > > I have a problem understanding the behaviour of this snippet: > > data_set = ({"param":"a"},{"param":"b"},{"param":"c"}) > > for i in range(len(data_set)): >     ds = data_set[:] >     data = ds[i] >     if i == 1: data['param'] = "y

Re: understanding list scope

2008-09-21 Thread alex23
On Sep 21, 10:51 pm, Alex <[EMAIL PROTECTED]> wrote: > Why? I'm coping data_set in ds so why data_set is changed? You're making a copy of the ds tuple, which has the -same- contents as the original. To create copies of the contents as well, try the deepcopy function from the copy module. As an as

Re: understanding list scope

2008-09-21 Thread Alex
On 21 Set, 15:07, George Sakkis <[EMAIL PROTECTED]> wrote: > On Sep 21, 8:51 am, Alex <[EMAIL PROTECTED]> wrote: > > > > > Hi all! > > > I have a problem understanding the behaviour of this snippet: > > > data_set = ({"param":"a"},{"param":"b"},{"param":"c"}) > > > for i in range(len(data_set)): >

Re: How to kill threading.Thread instance?

2008-09-21 Thread dmitrey
I wonder why something like myThread.exit() or myThread.quit() or threading.kill(myThread) can't be implemented? Is something like that present in Python 3000? Regards, D. -- http://mail.python.org/mailman/listinfo/python-list

Re: How to kill threading.Thread instance?

2008-09-21 Thread Diez B. Roggisch
dmitrey schrieb: I wonder why something like myThread.exit() or myThread.quit() or threading.kill(myThread) can't be implemented? Is something like that present in Python 3000? Not that I'm aware of it (which doesn't mean to much though). However I *am* aware of the bazillions discussions that

Re: How to kill threading.Thread instance?

2008-09-21 Thread Fredrik Lundh
Diez B. Roggisch wrote: I wonder why something like myThread.exit() or myThread.quit() or threading.kill(myThread) can't be implemented? Is something like that present in Python 3000? Not that I'm aware of it (which doesn't mean to much though). However I *am* aware of the bazillions discussi

Override the '+' symbol

2008-09-21 Thread Mr.SpOOn
Hi, how can I override the '+' symbol (and other math symbols) so that it can have a new behavior when applied to some objects? -- http://mail.python.org/mailman/listinfo/python-list

Re: Override the '+' symbol

2008-09-21 Thread Navtej Singh
http://docs.python.org/ref/numeric-types.html On Sun, Sep 21, 2008 at 8:37 PM, Mr.SpOOn <[EMAIL PROTECTED]> wrote: > Hi, > how can I override the '+' symbol (and other math symbols) so that it > can have a new behavior when applied to some objects? > -- > http://mail.python.org/mailman/listinfo/p

Re: Override the '+' symbol

2008-09-21 Thread Fredrik Lundh
Mr.SpOOn wrote: how can I override the '+' symbol (and other math symbols) so that it can have a new behavior when applied to some objects? see "Emulating Numeric Types" in the language reference: http://www.python.org/doc/ref/numeric-types.html -- http://mail.python.org/mailman/listin

Why are "broken iterators" broken?

2008-09-21 Thread Steven D'Aprano
According to the Python docs, once an iterator raises StopIteration, it should continue to raise StopIteration forever. Iterators that fail to behave in this fashion are deemed to be "broken": http://docs.python.org/lib/typeiter.html I don't understand the reasoning behind this. As I understand

Re: Why are "broken iterators" broken?

2008-09-21 Thread Fredrik Lundh
Steven D'Aprano wrote: According to the Python docs, once an iterator raises StopIteration, it should continue to raise StopIteration forever. Iterators that fail to behave in this fashion are deemed to be "broken": http://docs.python.org/lib/typeiter.html I don't understand the reasoning be

Deploying a Python Service on Apache Axis2

2008-09-21 Thread Heshan Suriyaarachchi
Hi guys, Apache Axis2/Java, is a popular open source Web service engine. It currently supports exposing services written in Java, Javascript as Web services. This article [1] discusses the Python data Binding that enable exposing Web services written in Python. [1] - http://wso2.org/library/a

Re: Problem with Python shell through Cygwin Screen (Python/Vim/Screen combo)

2008-09-21 Thread Ant
On Sep 19, 7:08 pm, Jason Tishler <[EMAIL PROTECTED]> wrote: ... > There are known issues when trying to run a Windows program that > directly accesses the console under Cygwin.  For example: > >    http://mail.python.org/pipermail/python-list/2004-June/21.html > > AFAICT, you will have to use

Re: Why are "broken iterators" broken?

2008-09-21 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > > According to the Python docs, once an iterator raises StopIteration, it > > should continue to raise StopIteration forever. Iterators that fail to > > behave in this fashion are deemed to be

Re: How to make a reverse for loop in python?

2008-09-21 Thread Alex Snast
On Sep 21, 3:47 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sat, 20 Sep 2008 16:27:41 -0700, Alex Snast wrote: > > Another quick question please, is the List data structure just a dynamic > > array? If so how can you use static size array, linked list, AVL trees > > etcet

Re: Why are "broken iterators" broken?

2008-09-21 Thread Fredrik Lundh
Roy Smith wrote: There are plausible examples of collections which grow while you're iterating over them. I'm thinking specifically of a queue in a multi-threaded application. One thread pushes work onto the back of the queue while another pops from the front. The queue could certainly go

I tried erlang-ish [1|2] in python and something came out...

2008-09-21 Thread process
In erlang you can cons like this: [1|2]. i tried this in python and it didnt raise an error but i dont know what the result do >>> [1|2] [3] >>> [2|2] [2] >>> a = [2|2] >>> a [2] >>> [2|3] [3] >>> [2|1] [3] >>> -- http://mail.python.org/mailman/listinfo/python-list

Re: I tried erlang-ish [1|2] in python and something came out...

2008-09-21 Thread Gary Herron
process wrote: In erlang you can cons like this: [1|2]. i tried this in python and it didnt raise an error but i dont know what the result do In Python | is the logical bitwise-OR operator. Look at the binary representation of the numbers to understand it. Gary Herron [1|2]

Re: curses.setsyx()?

2008-09-21 Thread linkmaster032000
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 after?  setsyx

Re: I tried erlang-ish [1|2] in python and something came out...

2008-09-21 Thread Chris Rebert
On Sun, Sep 21, 2008 at 10:02 AM, process <[EMAIL PROTECTED]> wrote: > In erlang you can cons like this: [1|2]. i tried this in python and it > didnt raise an error but i dont know what the result do In Python, like in C, the "|" operator on integers performs a bitwise-OR. To "cons" nondestructive

Re: BeautifulSoup and Problem Tables

2008-09-21 Thread Peter Pearson
On Sat, 20 Sep 2008 20:51:52 -0700 (PDT), [EMAIL PROTECTED] wrote: [snip] > from BeautifulSoup import BeautifulSoup > bst=file(r"c:\bstest.htm").read() > soup=BeautifulSoup(bst) > rows=soup.findAll('tr') > len(rows) > a=len(rows[0].findAll('td')) > b=len(rows[1].findAll('td')) > c=len(rows[2].findA

Some questions about PyOpenGL and wxPython

2008-09-21 Thread Clay Hobbs
I am making a program with wxPython that renders objects in 3D using PyOpenGL, and I am having some problems. For one thing, I forgot how to make a double-buffered hardware surface. For another thing, glColor(1.0, 0.0, 0.0) just before the rendering doesn't make the object red. Please help, I'm

Milenko Kindl rtegdgd

2008-09-21 Thread yuma
Milenko Kindl Banja Luka Banjaluka Bihac -- http://mail.python.org/mailman/listinfo/python-list

Re: understanding list scope

2008-09-21 Thread Peter Pearson
On Sun, 21 Sep 2008 06:17:36 -0700 (PDT), Alex wrote: > On 21 Set, 15:07, George Sakkis <[EMAIL PROTECTED]> wrote: >> On Sep 21, 8:51 am, Alex <[EMAIL PROTECTED]> wrote: [snip] >> > I have a problem understanding the behaviour of this snippet: [snip] >> Because you're doing a shallow copy: >> http:

Re: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-21 Thread Gabriel Genellina
En Sat, 20 Sep 2008 16:07:12 -0300, Blubaugh, David A. <[EMAIL PROTECTED]> escribió: Let me state that do have extensive experience with developing binary files. Please note that I have followed all of the instructions to the letter as far as developing a DLL to be imported. However, it i

Re: report a BUG of package setuptools-0.6c8.

2008-09-21 Thread Gabriel Genellina
En Sun, 21 Sep 2008 06:46:54 -0300, Sebastien Douche <[EMAIL PROTECTED]> escribió: 2008/9/20 Carl Banks <[EMAIL PROTECTED]>: On Sep 20, 1:11 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: 为爱而生 wrote: > File "/usr/lib/python2.5/site-packages/setuptools/command/sdist.py", > line 98, in entr

Re: Some questions about PyOpenGL and wxPython

2008-09-21 Thread Mike C. Fletcher
Clay Hobbs wrote: I am making a program with wxPython that renders objects in 3D using PyOpenGL, and I am having some problems. For one thing, I forgot how to make a double-buffered hardware surface. http://bazaar.launchpad.net/~mcfletch/openglcontext/trunk/annotate/1?file_id=wxcontext.py-20080

Newick parser

2008-09-21 Thread aditya shukla
Hello folks , i have a .nwk file.I want to parser the tree from that file.I found this python parser for newick trees. http://www.daimi.au.dk/~mailund/newick.html But i don't understand the usage properly.What i wanna do is if i have a file in the location c:\\files\\file1.nwk , then i wanna parse

Re: Newick parser

2008-09-21 Thread Fredrik Lundh
aditya shukla wrote: Hello folks , i have a .nwk file.I want to parser the tree from that file.I found this python parser for newick trees. http://www.daimi.au.dk/~mailund/newick.html But i don't understand the usage properly.What i wanna do is if i have a file in the location c:\\files\\file

Re: Here's something interesting: sympy crashes in Python 2.6 (Windows)

2008-09-21 Thread Mensanator
On Sep 21, 4:37 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Mensanator wrote: > > I'm not the one who wrote sympy, so I guess I'm not > > the only one who didn't notice it. > > > If it's a well known problem, then sorry I wasted > > your time. > > Given that 2.5 explicitly warns about this speci

Re: Why are "broken iterators" broken?

2008-09-21 Thread Terry Reedy
Steven D'Aprano wrote: According to the Python docs, once an iterator raises StopIteration, it should continue to raise StopIteration forever. Iterators that fail to behave in this fashion are deemed to be "broken": http://docs.python.org/lib/typeiter.html I don't understand the reasoning beh

Re: How to kill threading.Thread instance?

2008-09-21 Thread Fuzzyman
On Sep 21, 4:04 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Diez B. Roggisch wrote: > >> I wonder why something like myThread.exit() or myThread.quit() or > >> threading.kill(myThread) can't be implemented? > >> Is something like that present in Python 3000? > > > Not that I'm aware of it (which

Re: Milenko Kindl rtegdgd

2008-09-21 Thread H Vlems
On 21 sep, 19:48, yuma <[EMAIL PROTECTED]> wrote: > Milenko Kindl > Banja Luka > Banjaluka > Bihac Well, that's not C isn't it, more like Snobol or RPG/2 -- http://mail.python.org/mailman/listinfo/python-list

Twisted: Get Protected HTTPS Page via Proxy with Authentication

2008-09-21 Thread Robert Hancock
from twisted.web import client from twisted.internet import reactor import base64 import sys def printPage(data): print data reactor.stop() def printError(failure): print >> sys.stderr, "Error:", failure.getErrorMessage() reactor.stop() if len(sys.argv) == 4: url = sys.argv[1

Re: Milenko Kindl rtegdgd

2008-09-21 Thread Martin Griffith
On Sun, 21 Sep 2008 15:00:16 -0700 (PDT), in sci.electronics.design H Vlems <[EMAIL PROTECTED]> wrote: >On 21 sep, 19:48, yuma <[EMAIL PROTECTED]> wrote: >> Milenko Kindl >> Banja Luka >> Banjaluka >> Bihac > >Well, that's not C isn't it, more like Snobol or RPG/2 It's better to say "that's not C,

Re: report a BUG of package setuptools-0.6c8.

2008-09-21 Thread Sebastien Douche
On Sun, Sep 21, 2008 at 19:56, Gabriel Genellina <[EMAIL PROTECTED]> wrote: >> http://bugs.python.org/setuptools/ > > And how do people manage to know that? Bugtracker send emails on setuptools mailing list. -- Seb -- http://mail.python.org/mailman/listinfo/python-list

Re: how can i check whether a variable is iterable in my code?

2008-09-21 Thread James Mills
satoru, I should point out that the normal approach is to just try whatever it is that you're doing, and let it fail where it fails. For example: def processSeq(x): for i in x: print i processSeq([1, 2, 3]) processSeq("foobar") processSeq(5) <-- This will fail. cheers James On Sat, Se

What do you call a class not intended to be instantiated

2008-09-21 Thread Steven D'Aprano
I have a class which is not intended to be instantiated. Instead of using the class to creating an instance and then operate on it, I use the class directly, with classmethods. Essentially, the class is used as a function that keeps state from one call to the next. The problem is that I don't k

RE: NEW GENERATED DLL ERROR FOUND WITHIN f2PY.py

2008-09-21 Thread Blubaugh, David A.
Sir, Thank you for your reply. This is as to how I developed my .pyd file. I entered the following commands within my MS-DOS prompt within Windows XP: C:\python25\Scripts> C:\python25\python f2py.py -c --fcompiler=gnu95 --compiler=mingw32 -m hello hello.f90 I am using the gfortran compiler

appending * to glob returns files with '*' !!

2008-09-21 Thread John [H2O]
I have a glob.glob search: searchstring = os.path.join('path'+'EN*') files = glob.glob(searchstring) for f in files: print f ___ This returns some files: EN082333 EN092334 EN* My routine cannot handle the '*' and it should'nt be returned anyway? :-/ A bug? -- View this message in con

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread James Mills
Hi, Wouldn't a normal class called State suffice for storing state between calls ? And ... Creating a state instance ? For example: class State(object): """State() -> new state object Creates a new state object that is suitable for holding different states of an application. Usefull

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread Steven D'Aprano
Fixing top-posting. On Mon, 22 Sep 2008 08:54:43 +1000, James Mills wrote: > On Mon, Sep 22, 2008 at 8:39 AM, Steven D'Aprano > <[EMAIL PROTECTED]> wrote: >> I have a class which is not intended to be instantiated. Instead of >> using the class to creating an instance and then operate on it, I us

Re: appending * to glob returns files with '*' !!

2008-09-21 Thread Sean DiZazzo
On Sep 19, 1:37 pm, "John [H2O]" <[EMAIL PROTECTED]> wrote: > I have a glob.glob search: > > searchstring = os.path.join('path'+'EN*') shouldn't that be os.path.join(path, 'EN*') ? > ___ > This returns some files: > EN082333 > EN092334 > EN* Mine doesn't return that last string. > > My routin

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread James Mills
On Mon, Sep 22, 2008 at 9:05 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > I'm not wedded to the idea, there are alternatives (perhaps the factory > should instantiate the class and return that?) but I assume others have > used this design and have a name for it. The problem is, I don't see why

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread Calvin Spealman
I call it an obvious misuse and misunderstanding of why you'd use a class in the first place. Either create an instance and not make these things classmethods or just share the stuff in a module-level set of variables. But the instantiating is the best options. Your class attributes might not be gl

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread bearophileHUGS
Steven D'Aprano: > I have a class which is not intended to be instantiated. Instead of using > the class to creating an instance and then operate on it, I use the class > directly, with classmethods. Essentially, the class is used as a function > that keeps state from one call to the next. You may

Re: appending * to glob returns files with '*' !!

2008-09-21 Thread alex23
On Sep 20, 6:37 am, "John [H2O]" <[EMAIL PROTECTED]> wrote: > My routine cannot handle the '*' and it should'nt be returned anyway? :-/ > > A bug? Not at all. That's the same behaviour you'll get if you do 'ls EN*'. In your case, you're asking to match on anything that begins with EN, a subset of

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread James Mills
On Mon, Sep 22, 2008 at 9:39 AM, Calvin Spealman <[EMAIL PROTECTED]> wrote: > I call it an obvious misuse and misunderstanding of why you'd use a class in > the first place. Either create an instance and not make these things > classmethods or just share the stuff in a module-level set of variables

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread Aaron "Castironpi" Brady
On Sep 21, 6:05 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > Fixing top-posting. > > On Mon, 22 Sep 2008 08:54:43 +1000, James Mills wrote: > > On Mon, Sep 22, 2008 at 8:39 AM, Steven D'Aprano > > <[EMAIL PROTECTED]> wrote: > >> I have a class which is not intended to be inst

Re: What do you call a class not intended to be instantiated

2008-09-21 Thread Ben Finney
Steven D'Aprano <[EMAIL PROTECTED]> writes: > I have a class which is not intended to be instantiated. Instead of > using the class to creating an instance and then operate on it, I > use the class directly, with classmethods. Essentially, the class is > used as a function that keeps state from on

pause between the loops

2008-09-21 Thread Jackie Wang
Hi all, For a loop like: for i = range (0,10); can I ask python to stop for, say, 5mins, after it go through loop i=0 before it starts loop i=1? Thank you very much! Jackie -- http://mail.python.org/mailman/listinfo/python-list

Re: appending * to glob returns files with '*' !!

2008-09-21 Thread Erik Max Francis
John [H2O] wrote: I have a glob.glob search: searchstring = os.path.join('path'+'EN*') files = glob.glob(searchstring) for f in files: print f ___ This returns some files: EN082333 EN092334 EN* My routine cannot handle the '*' and it should'nt be returned anyway? :-/ A bug? No, it me

Re: pause between the loops

2008-09-21 Thread skip
Jackie> can I ask python to stop for, say, 5mins, after it go through Jackie> loop i=0 before it starts loop i=1? import time for i in range(10): time.sleep(5) # seconds Skip -- http://mail.python.org/mailman/listinfo/python-list

Re: Milenko Kindl rtegdgd

2008-09-21 Thread Michael A. Terrell
H Vlems wrote: > > On 21 sep, 19:48, yuma <[EMAIL PROTECTED]> wrote: > > Milenko Kindl > > Banja Luka > > Banjaluka > > Bihac > > Well, that's not C isn't it, more like Snobol or RPG/2 Tidybowl -- http://improve-usenet.org/index.html aioe.org, Goggle Groups, and Web TV users must reques

Re: BeautifulSoup and Problem Tables

2008-09-21 Thread clurks
[EMAIL PROTECTED] wrote: > Hi > > I would appreciate some help. I am trying to learn Python and want to > use BeautifulSoup to pull some data from tables. I was really psyched > earlier tonight when I discovered that I could do this > > from BeautifulSoup import BeautifulSoup > bst=file(r"c:\b

New Web2Py framework SLASHES development time...

2008-09-21 Thread Steve Shephed
http://www.web2py.com Web2Py - Python Framework is the newest kid on the block for Python frameworks. It has a lot of features that simply are not there in other frameworks. Even Ruby!. You can design database models graphically online. The templating language is pure python and there are no prob

Re: Milenko Kindl rtegdgd

2008-09-21 Thread Jim Thompson
On Sun, 21 Sep 2008 22:26:27 -0400, "Michael A. Terrell" <[EMAIL PROTECTED]> wrote: > >H Vlems wrote: >> >> On 21 sep, 19:48, yuma <[EMAIL PROTECTED]> wrote: >> > Milenko Kindl >> > Banja Luka >> > Banjaluka >> > Bihac >> >> Well, that's not C isn't it, more like Snobol or RPG/2 > > > Tidybow

Question about sorted in Python 3.0rc1

2008-09-21 Thread josh logan
Hello, I have 2 questions. Say I have this class: class Player(object): def __init__(self, fname, lname, score): self.score = score self.fname = fname self.lname = lname def __cmp__(self, other): return (-cmp(self.score, other.score) or cmp

Re: Milenko Kindl rtegdgd

2008-09-21 Thread Paul Hovnanian P.E.
yuma wrote: > > Milenko Kindl > Banja Luka > Banjaluka > Bihac Try facing Mecca while repeating that and your source will compile. -- Paul Hovnanian mailto:[EMAIL PROTECTED] -- Leap and the net will appear. -- http://mail.pytho

Re: Why are "broken iterators" broken?

2008-09-21 Thread Cameron Simpson
On 21Sep2008 18:36, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Roy Smith wrote: >> There are plausible examples of collections which grow while you're >> iterating over them. I'm thinking specifically of a queue in a >> multi-threaded application. One thread pushes work onto the back of >> t

Re: Why are "broken iterators" broken?

2008-09-21 Thread Miles
On Sun, Sep 21, 2008 at 11:13 AM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > According to the Python docs, once an iterator raises StopIteration, it > should continue to raise StopIteration forever. Iterators that fail to > behave in this fashion are deemed to be "broken": > > http://docs.python.

Re: Milenko Kindl rtegdgd

2008-09-21 Thread James Dow Allen
On Sep 22, 5:08 am, Martin Griffith <[EMAIL PROTECTED]> wrote: > On Sun, 21 Sep 2008 15:00:16 -0700 (PDT), in sci.electronics.design H > >Well, that's not C isn't it, more like Snobol or RPG/2 > > It's better to say > "that's not C, is it" > > I don't know why, but that's the way it works. I r

Re: dict generator question

2008-09-21 Thread Miles
On Fri, Sep 19, 2008 at 9:51 PM, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > Extending len() to support iterables sounds like a good idea, except that > it's not. > > Here are two iterables: > > > def yes(): # like the Unix yes command >while True: >yield "y" > > def rand(total): >