RE: Method overloading?

2007-02-15 Thread Delaney, Timothy (Tim)
Steven D'Aprano wrote: > This is an example of overloading: > > class Cheese(object): > def flavour(self): > return "tasty and scrumptious" > def colour(self): > return "yellow" > > Now we define a sub-class which overloads some methods: > > class BlueVein(Cheese): >

Re: f---ing typechecking

2007-02-15 Thread Paul Rubin
Donn Cave <[EMAIL PROTECTED]> writes: > If t is a valid argument tuple for function f, then can t[1:] > also be a valid argument tuple for function f? > > For ordinary functions without special argument handling, no. > We know that without having to know anything about t, and not > much about f.

Re: Method overloading?

2007-02-15 Thread placid
On Feb 16, 3:37 am, Neil Cerutti <[EMAIL PROTECTED]> wrote: > On 2007-02-15, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > > >> def multiAccept( argOfVariousTypes ): > >> if isinstance(argOfVariousTypes,int): > >> # treat like an int > >> elif isinstance(argOfVariousTypes,float): > >

cmath, __float__ and __complex__

2007-02-15 Thread Mark Dickinson
I was a little surprised by the following behaviour: Python 2.5 (r25, Oct 30 2006, 20:50:32) [GCC 4.0.1 (Apple Computer, Inc. build 5363)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from cmath import sqrt >>> class NumericType1(object): ... def __float

Re: f---ing typechecking

2007-02-15 Thread Paul McGuire
On Feb 15, 5:21 pm, Paul Rubin wrote: > How can there be a structure datatype with an unpredictable > number of members? > > It might have come across as a different question-sorry for any > confusion. This may be where the "tuple is like a struct" analogy isn't so good,

Re: f---ing typechecking

2007-02-15 Thread Paul Rubin
"Paul McGuire" <[EMAIL PROTECTED]> writes: > Now what is it you want to do with args that you can't do with it as a > tuple? I'm ok with it being a tuple, but I'm not so wed to the notion that tuples are record structures. I think it would be lame to not be able to iterat through the arg list,

Python's freeze.py utility

2007-02-15 Thread Mitko Haralanov
OK, this might be a stupid question: for the life of me, I can't find Python's freeze.py utility in the Python distribution that comes with FC6. Has it been removed from the distribution? Has it been removed from Python? I have FC6's python-2.4.4 rpms installed (python, python-devel, python-tools

numpy, numarray, or numeric?

2007-02-15 Thread Christian Convey
I need to bang out an image processing library (it's schoolwork, so I can't just use an existing one). But I see three libraries competing for my love: numpy, numarray, and numeric. Can anyone recommend which one I should use? If one is considered the officially blessed one going forward, that w

Re: output to console and to multiple files

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 19:35:10 -0300, Matimus <[EMAIL PROTECTED]> escribió: >> I think you should be able to use my or goodwolf's solution with the >> subprocess module. Something like this (untested): >> >> [code] >> class TeeFile(object): >> def __init__(self,*files): >> self.files = f

Re: SystemError: _PyImport_FixupExtension: module _types not loaded

2007-02-15 Thread usenet1
After installing activestate python 2.4 and ctypes-1.0.1.win32- py2.4.exe, everything just worked. So, I decided to stay with 2.4 since I don't have time to figure out the problem. Steve -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's freeze.py utility

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 21:18:51 -0300, Mitko Haralanov <[EMAIL PROTECTED]> escribió: > OK, this might be a stupid question: for the life of me, I can't find > Python's freeze.py utility in the Python distribution that comes with > FC6. > > Has it been removed from the distribution? Has it been remo

Re: Pep 3105: the end of print?

2007-02-15 Thread Edward K Ream
> Isn't the very concept of major releases (1.x, 2.x, 3.x) that they *can* > be not backwards-compatible with previous releases? Not at all. Backwards compatibility means that one can still run old code provided the code eschews new features. Python releases have generally been backwards com

Re: SystemError: _PyImport_FixupExtension: module _types not loaded

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 21:49:56 -0300, <[EMAIL PROTECTED]> escribió: > After installing activestate python 2.4 and ctypes-1.0.1.win32- > py2.4.exe, everything just worked. So, I decided to stay with 2.4 > since I don't have time to figure out the problem. Glad to see it worked, at least on 2.4 --

Re: builtin set literal

2007-02-15 Thread Schüle Daniel
[...] >>> In Python 3.0, this looks like:: >>> >>> s = {1,2,3} >> >> jepp, that looks not bad .. as in a mathe book. >> the only disadvantage I see, that one may confuse it with a dict. > > Perhaps with a very cursory inspection. But the lack of any ':' > characters is a pretty quick clue-in

Re: filecmp.cmp() cache

2007-02-15 Thread Steve Holden
Peter Otten wrote: > Mattias Brändström wrote: > >> On Feb 15, 5:56 pm, Peter Otten <[EMAIL PROTECTED]> wrote: >>> You can clear the cache with >>> >>> filecmp._cache = {} >>> >>> as a glance into the filecmp module would have shown. >> You are right, a quick glance would have enlighten me. Next t

Re: Pep 3105: the end of print?

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 22:04:34 -0300, Edward K Ream <[EMAIL PROTECTED]> escribió: > In other words, the consequence of pep 3105 will be that *nobody* who > wants > their app to be portable will be able to use print until *everybody* has > converted to Python 3.x. I doubt that is what Guido had

Re: builtin set literal

2007-02-15 Thread MRAB
On Feb 15, 4:12 pm, Schüle Daniel <[EMAIL PROTECTED]> wrote: > [...] > > >>> In Python 3.0, this looks like:: > > >>> s = {1,2,3} > > >> jepp, that looks not bad .. as in a mathe book. > >> the only disadvantage I see, that one may confuse it with a dict. > > > Perhaps with a very cursory inspe

Re: Pep 3105: the end of print?

2007-02-15 Thread Ben Finney
"Edward K Ream" <[EMAIL PROTECTED]> writes: > > Isn't the very concept of major releases (1.x, 2.x, 3.x) that they > > *can* be not backwards-compatible with previous releases? > > Not at all. In the context of the question, this answer seems to say that a major release *must* be backwards-compat

Re: numpy, numarray, or numeric?

2007-02-15 Thread RickMuller
On Feb 15, 5:40 pm, "Christian Convey" <[EMAIL PROTECTED]> wrote: > I need to bang out an image processing library (it's schoolwork, so I > can't just use an existing one). But I see three libraries competing > for my love: numpy, numarray, and numeric. > > Can anyone recommend which one I should

spam magnet

2007-02-15 Thread a a
Hello, I hear (from google) that people get a lot of spam after posting to this list. That's nice, because I, [EMAIL PROTECTED] , happen to want a lot of spam :) Anyone who would like to send me their spam is welcome to as well (full headers please, I'm trying to track & corellate those wascally bo

The Python Papers Volume 2 Issue 1 HTML now available

2007-02-15 Thread [EMAIL PROTECTED]
http://archive.pythonpapers.org/ThePythonPapersVolume2Issue1.html Hi Pythonistas! The HTML version of the latest edition of The Python Papers is now available from the above URL. The editors understand that the web layout lacks the sophistication of the PDF, or indeed that possible under HTML. Ho

The Python Papers Volume 2 Issue 1 HTML now available

2007-02-15 Thread [EMAIL PROTECTED]
http://archive.pythonpapers.org/ThePythonPapersVolume2Issue1.html Hi Pythonistas! The HTML version of the latest edition of The Python Papers is now available from the above URL. The editors understand that the web layout lacks the sophistication of the PDF, or indeed that possible under HTML. Ho

Re: builtin set literal

2007-02-15 Thread Raymond Hettinger
>> What about "{,}"? For consistency "(,)" and "[,]" might >> also have to be permissible, and maybe even "{:}" for an >> empty dict. The notion of a set literal was rejected in PEP 218, http://www.python.org/dev/peps/pep-0218/ . One of the reasons for the rejection was that the small benefit of a

Re: Tkinter __call__

2007-02-15 Thread John McMonagle
Gigs_ wrote: > from Tkinter import * > from tkFileDialog import askopenfilename > from tkColorChooser import askcolor > from tkMessageBox import askquestion, showerror > from tkSimpleDialog import askfloat > > demos = { > 'Open': askopenfilename, > 'Color': askcolor, > 'Query':

Re: IOError: [Errno 4] Interrupted system call

2007-02-15 Thread chadrik
i'm getting the same error when trying to read results from popen2 within a pyQt window. is this a threading issue? is my pyQt window responsible for interrupting the read? i'm fairly new to python so i'm struggling to figure this out. can you recommend any possible methods of preventing this? fo

PIL problems

2007-02-15 Thread Jamie Bohr
I am trying to allow JPEG's to be used for portraits inside of Plone. I have Googled and found I need to install the Pytphon Imaging Library (PIL); after that all should be good. I did that, but I an error that tells me there is a missing library. The below is a log of what I did. From what I

Re: IOError: [Errno 4] Interrupted system call

2007-02-15 Thread Gabriel Genellina
En Thu, 15 Feb 2007 23:57:29 -0300, <[EMAIL PROTECTED]> escribió: > i'm getting the same error when trying to read results from popen2 > within a pyQt window. is this a threading issue? is my pyQt window > responsible for interrupting the read? i'm fairly new to python so > i'm struggling to fig

Re: Pep 3105: the end of print?

2007-02-15 Thread Steven Bethard
Edward K Ream wrote: >> You could offer up a patch for Python 2.6 so that you can do:: >>from __future__ import print_function > > This would only work for Python 2.6. Developers might want to support Python > 2.3 through 2.5 for awhile longer :-) Python 3.0 is determined not to be hampered

Re: Enter Enter... troubles

2007-02-15 Thread Hendrik van Rooyen
Sorin Schwimmer wrote: 8<- > def handler(self,event): >self.aButton.unbind('') >self.aButton.unbind('') 8<- > >The idea is to prevent a fast user (like my boss) to press repeatedly the "enter" >key and create havoc with self.property and

Re: numpy, numarray, or numeric?

2007-02-15 Thread Frank
On Feb 15, 4:40 pm, "Christian Convey" <[EMAIL PROTECTED]> wrote: > I need to bang out an image processing library (it's schoolwork, so I > can't just use an existing one). But I see three libraries competing > for my love: numpy, numarray, and numeric. > > Can anyone recommend which one I should

I'm faint why this can't work

2007-02-15 Thread JStoneGT
Hello, I got this similar sample script from books: $ cat sampdict.py #!/usr/bin/python class SampDict(dict): def __init__(self, filename=None): self["name"] = filename But when I run it I got the errors: >>> from sampdict import SampDict >>> SampDict("/etc/passwd") Traceback (mo

Re: how do "real" python programmers work?

2007-02-15 Thread Hendrik van Rooyen
"Tim Golden" <[EMAIL PROTECTED]> wrote: > Tyrrell, Wendy wrote: > > (Well, nothing) > 8<-- > Your organisation seems to deal with partnerships between > business and education; are you looking to promote the use > of programming in schools? Or is there something else you

<    1   2