Re: removing list comprehensions in Python 3.0

2005-07-10 Thread Bengt Richter
On Sat, 09 Jul 2005 22:32:22 -0600, Steven Bethard <[EMAIL PROTECTED]> wrote: >Raymond Hettinger wrote: >> [Steven Bethard] >> >>>I would hope that in Python 3.0 list comprehensions and generator >>>expressions would be able to share a large amount of implementation, and >>>thus that the speed di

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Thomas Lotze
Steven D'Aprano wrote: > On the gripping hand, testing for errors before they happen will be slow > if errors are rare: Hm, might have something to do with why those things intended for handling errors after they happened are called exceptions ;o) > - If your code has side effects (eg changing e

Re: Use cases for del

2005-07-10 Thread Reinhold Birkenfeld
Ron Adam wrote: >> >>> 'abc' is 'abcd'[:3] >> False > > Well of course it will be false... your testing two different strings! > And the resulting slice creates a third. > > Try: > > ABC = 'abc' > > value = ABC > if value is ABC: # Test if it is the same object > pass That's not

What is Expresiveness in a Computer Language?

2005-07-10 Thread Xah Lee
What is Expresiveness in a Computer Language 20050207, Xah Lee. In languages human or computer, there's a notion of expressiveness. English for example, is very expressive in manifestation, witness all the poetry and implications and allusions and connotations and dictions. There are a myriad wa

ZipFile and file rigths

2005-07-10 Thread perchef
hi, i have written this small code which allow me to unzip files using python : import zipfile import os import os.path pathDir="/home/toto/Desktop" pathZip= os.path.join(pathDir,"foobar.zip") if zipfile.is_zipfile(pathZip): zf = zipfile.ZipFile(pathZip) for file in zf.namelist():

Re: Python Forum

2005-07-10 Thread Michael Hoffman
Throne Software wrote: > Throne Software has opened up a Python Forum at: > > http://www.thronesoftware.com/forum/ > > Join us! Why shouldn't I just stay here? -- Michael Hoffman -- http://mail.python.org/mailman/listinfo/python-list

passing arguments to a function - do I need type ?

2005-07-10 Thread Philipp H. Mohr
Hello, I got a newbie question, I have written the following distance function: def distance(self,element1, element2): dist = 0 for n in range(len(element1)): dist = dist + pow((element1[n] - element2[n]),2) print 'dist' + dist return sqrt(dist) and i

Newbie Alert! Upgrading Python?

2005-07-10 Thread El
Hi, Sorry to bother you folks with a real newbie question, but I am sure that this is the place for me to ask. Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year old computer. My computer has always been upgraded to include the latest programs and Windows updates. Ho

Re: [ANNOUNCE] pysudoku 0.1

2005-07-10 Thread sudoku
Thanks Glenn, I added your link to our Sudoku Links List: http://sudoku.jouwpagina.nl Xander "Glenn Hutchings" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Announcing PySuDoku version 0.1, yet another Sudoku program written in > Python. But this one has features that I don'

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Steven D'Aprano
On Sun, 10 Jul 2005 12:15:25 +0530, Dark Cowherd wrote: > http://www.joelonsoftware.com/items/2003/10/13.html Joel Spolsky might be a great C++ programmer, and his advice on user interface design is invaluable, but Python is not C++ or Java, and his arguments about exceptions do not hold in Pytho

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Roy Smith
Thomas Lotze <[EMAIL PROTECTED]> wrote: > Basically, I agree with the "make it run, make it right, make it fast" > attitude. However, FWIW, I sometimes can't resist optimizing routines that > probably don't strictly need it. Not only does the resulting code run > faster, but it is usually also shor

Re: Newbie Alert! Upgrading Python?

2005-07-10 Thread Thorsten Kampe
* El (2005-07-10 11:56 +0100) > Sorry to bother you folks with a real newbie question, but I am sure that > this is the place for me to ask. > > Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year > old computer. My computer has always been upgraded to include the latest

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread John Roth
"Thomas Lotze" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Steven D'Aprano wrote: > > > Basically, I agree with the "make it run, make it right, make it fast" > attitude. However, FWIW, I sometimes can't resist optimizing routines that > probably don't strictly need it. Not only

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Thorsten Kampe
* John Roth (2005-07-09 21:48 +0100) > "Thorsten Kampe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >>* Steve Juranich (2005-07-09 19:21 +0100) >>> I know that this topic has the potential for blowing up in my face, >>> but I can't help asking. I've been using Python since 1.5.1

Re: Python Module Exposure

2005-07-10 Thread George Sakkis
"Jacob Page" <[EMAIL PROTECTED]> wrote: > If the union of two integers yielded a set of integers, then > it'd make more since for the union of two Intervals to yield an > IntervalSet. AFAIK union is defined over sets, not numbers, so I'm not sure what you mean by the "union of two integers". What

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread Jorgen Grahn
(You posted your question as a followup to oen of Xah Lee's musings. That is not the best of ideas, since people with threaded newsreaders tend not to see it. Just post (creating a new thread) next time.) On Sun, 10 Jul 2005 11:19:31 +0100 (BST), Philipp H. Mohr <[EMAIL PROTECTED]> wrote: > Hello

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Jorgen Grahn
On Sun, 10 Jul 2005 22:10:50 +1000, Steven D'Aprano <[EMAIL PROTECTED]> wrote: > On Sun, 10 Jul 2005 12:15:25 +0530, Dark Cowherd wrote: > >> http://www.joelonsoftware.com/items/2003/10/13.html > > Joel Spolsky might be a great C++ programmer, and his advice on user > interface design is invaluable

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread George Sakkis
"Philipp H. Mohr" <[EMAIL PROTECTED]> wrote: > Hello, > I got a newbie question, I have written the following distance function: > > def distance(self,element1, element2): > dist = 0 > > for n in range(len(element1)): > dist = dist + pow((element1[n] - element2[n]),2) >

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Jorey Bump
Daniel Bickett <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > I neglected to mention an important fact, and that is the fact that I > am limited to Apache, which elminates several suggestions (that are > appreciated none-the-less). "Limited to Apache" is not the same as "using apache in

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Aahz
Roy, I know you actually know this stuff, but for the benefit of beginners In article <[EMAIL PROTECTED]>, Roy Smith <[EMAIL PROTECTED]> wrote: > >3) In some cases, they can lead to faster code. A classic example is >counting occurances of items using a dictionary: > > count = {} > for

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Paul Boddie
"Robert Brewer" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > Daniel Bickett wrote: > > I neglected to mention an important fact, and that is the fact that I > > am limited to Apache, which elminates several suggestions (that are > > appreciated none-the-less). > > Do you have

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Ralf W. Grosse-Kunstleve
--- Kay Schluehr <[EMAIL PROTECTED]> wrote: > > I stripped your code down to the essence. See attachment. > > For the user your approach then becomes: > > > > class grouping: > > __metaclass__ = autoattr > > def __init__(self, x, y, z): > > pass > > No. This is clearly NOT what I

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Roy Smith
[EMAIL PROTECTED] (Aahz) wrote: > Using ``in`` saves a bytecode of method lookup on ``has_key()`` (which is > the correct spelling). You are right. My example is somewhat out of date w/r/t newer language features, and writing hasKey() instead of has_key() was just plain a mistake. Thanks for t

Re: Python Forum

2005-07-10 Thread Peter Hansen
Devan L wrote: > I see a total of 12 posts and 8 users. Which at least makes it a record so far, surpassing every other "hey, i just made a new forum, it's awesome and everyone should join!" post that has been made here in the past, by about 9 posts and 5 users... ;-) -Peter -- http://mail.pyt

Re: Newbie Alert! Upgrading Python?

2005-07-10 Thread Peter Hansen
Thorsten Kampe wrote: > * El (2005-07-10 11:56 +0100) >>Python 1.5.1 (final) and Python Win32 Extensions are installed on my 4 year > > If you don't use it: uninstall Python. If something else uses it: keep > it as it is as your app might break with the new Python - even though > 2.4 is backwards

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread raptor
I think u are wrong.. I think perl is much more exrpressive in semantics than Python.. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Steven D'Aprano
On Sun, 10 Jul 2005 07:20:34 -0700, raptor wrote: > I think u are wrong.. I think perl is much more exrpressive in > semantics than Python.. Well, with such great command of natural language as you are displaying, how could anyone argue with your conclusion? -- Steven. -- http://mail.python.o

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread Steven D'Aprano
On Sun, 10 Jul 2005 11:19:31 +0100, Philipp H. Mohr wrote: > Hello, > I got a newbie question, I have written the following distance function: Great. Now, how about you tell us what you expect it to do? I assume it calculates the Euclidean distance between two points. (If you don't know what Eucl

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread Paul McGuire
Is getCenter a function? If so, you need to invoke distance using: dist = self.distance( n.getCenter(), newElement ) Of course, that is assuming that newElement is a local variable of type list/tuple/etc. -- Paul -- http://mail.python.org/mailman/listinfo/python-list

Re: passing arguments to a function - do I need type ?

2005-07-10 Thread Philipp H. Mohr
Hello, thank you very much for all your help. I have solved the problem - you guys where right, the problem was some where else. I have another class which got an accessor: def getCenter(self): global center return center and I called it by saying n.getCenter, but this returns:

PyArg_ParseTuple help

2005-07-10 Thread zyqnews
hello all, how to parse the arguments of a c function with PyArg_ParseTuple? The prototype of the c function is : int func(unsigned char * in , int inlen, unsigned char * v, unsigned char * out, int * outlen); The problem is , when the func returns, there will be results in out and outlen. Is

Re: Berkely DB – many writers, many readers

2005-07-10 Thread Eric S. Johansson
Andy Leszczynski wrote: > > I need to now option I open the Berkley DB (both db and env) to have > configuration for multiple writers and multiple readers. Via multiple > processes and multiple threads. No trx needed. the simple answer is you can't. bdbm is probably single writer multiple r

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Pete Barrett
On 10 Jul 2005 02:57:04 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: >Similarly, in computer languages, expressiveness is significant with >respect to semantics, not syntactical variation. > It may just be me, but I tend to think of a computer language as a tool for directing computers to perform s

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Jürgen Exner
Xah Lee wrote: > What is Expresiveness in a Computer Language[...] Just for the records at Google et.al. in case someone stumbles across Xah's masterpieces in the future: Xah is very well known as the resident troll in many NGs and his 'contributions' are less then useless. Best is to just igno

An absolute Newbie question

2005-07-10 Thread wpog
Hello, I have a question about using "IDLE", and that is whenever I start write my own program in the "Python Shell" it will automatically execute whatever command I have written, for example: >>> print 'Hello World" So, how to I get it to not execute, so that I can write a program that has o

Re: computer algebra packages

2005-07-10 Thread François Pinard
[Florian Diesch] > Probably this is usable for you (I never used any of them): > This system MAXIMA is [...] based on the original implementation of > Macsyma at MIT [...] Wow! A derivative of Joel Moses' integrator!! I was not aware this existed, so thanks for the pointer. It worked out of

Re: An absolute Newbie question

2005-07-10 Thread dirk dierickx
On Sun, 10 Jul 2005 16:41:23 +, wpog wrote: > So, how to I get it to not execute, so that I can write a program that has > ordinary executable functions, and stuff like that? file > open new window the new window will not execute your code you type in there. -- The first thing we do, let'

Re: An absolute Newbie question

2005-07-10 Thread Brian van den Broek
wpog said unto the world upon 10/07/2005 12:41: > Hello, > > I have a question about using "IDLE", and that is whenever I start write my > own program in the "Python Shell" it will automatically execute whatever > command I have written, for example: >>> print 'Hello World" > > So, how to I ge

Efficiency of using long integers to hold bitmaps

2005-07-10 Thread Jeff Melvaine
I note that I can write expressions like "1 << 100" and the result is stored as a long integer, which means it is stored as an integer of arbitrary length. I may need to use a large number of these, and am interested to know whether the storage efficiency of long integers is in danger of break

Re: An absolute Newbie question

2005-07-10 Thread Scott Durkin
wpog, In IDLE, go to the File menu and select New Window. You can write your program there. Just save the file with the extension .py, such as hello.py Once the program is written, you can save the changes and press F5 to run the script. If you haven't checked out the links below, you might wa

Re: Efficiency of using long integers to hold bitmaps

2005-07-10 Thread Raymond Hettinger
[Jeff Melvaine] > I note that I can write expressions like "1 << 100" and the result is stored > as a long integer, which means it is stored as an integer of arbitrary > length. I may need to use a large number of these, and am interested to > know whether the storage efficiency of long integers i

Re: computer algebra packages

2005-07-10 Thread François Pinard
> > Mascyma is (trying to be) a user-friendly graphical frontend for > > the Computer Algebra System GNU MAXIMA. > I was not successful googling for this one. Would you have an URL handy? Oops, OK! Found it at http://cens.ioc.ee/~pearu/misc/maxima/ . -- François Pinard http://pinard.pro

Re: Use cases for del

2005-07-10 Thread Ron Adam
Reinhold Birkenfeld wrote: > Ron Adam wrote: > > >>>>>> 'abc' is 'abcd'[:3] >>>False >> >>Well of course it will be false... your testing two different strings! >>And the resulting slice creates a third. >> >>Try: >> >>ABC = 'abc' >> >>value = ABC >>if value is ABC: # Test if it is the

Re: bsddb environment lock failure -- resolved

2005-07-10 Thread Barry
Upgrading db4 to db4-4.1.25-14.rpm seems to have take care of this. On 7/10/05, Barry <[EMAIL PROTECTED]> wrote: > I have python2.4.1 installed on two machines: > -- one is Fedora core 1, where the bsddb module works fine > -- one is Redhat ES 3.0, and I installed mysql 4.1 (and > mysql-python2

Re: ZipFile and file rigths

2005-07-10 Thread ralobao
You can use os.chmod to fix it. Here the description: os.chmod Docstring: chmod(path, mode) Change the access permissions of a file. Cheers, perchef escreveu: > hi, > > i have written this small code which allow me to unzip files using > python : > > import zipfile > import os > impor

Re: PyArg_ParseTuple help

2005-07-10 Thread Qiangning Hong
[EMAIL PROTECTED] wrote: > hello all, > how to parse the arguments of a c function with PyArg_ParseTuple? > The prototype of the c function is : > int func(unsigned char * in , int inlen, unsigned char * v, unsigned > char * out, int * outlen); > > The problem is , when the func returns, ther

urllib2.urlopen hangs, urllib.urlopen works?

2005-07-10 Thread Chris
hello, I have an odd behaviour. I try to download some files connected to a specific webpage (e.g. all stylesheets) with urllib2.urlopen(x) This seems to hang on the 2nd file or so. Doing the exact same thing via urllib.urlopen(x) does work without a hitch... I don't really to us

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Ron Adam
Roy Smith wrote: > Thomas Lotze <[EMAIL PROTECTED]> wrote: > >>Basically, I agree with the "make it run, make it right, make it fast" >>attitude. However, FWIW, I sometimes can't resist optimizing routines that >>probably don't strictly need it. Not only does the resulting code run >>faster, but

Re: Python Module Exposure

2005-07-10 Thread Jacob Page
George Sakkis wrote: > "Jacob Page" <[EMAIL PROTECTED]> wrote: > >>If the union of two integers yielded a set of integers, then >>it'd make more since for the union of two Intervals to yield an >>IntervalSet. > > AFAIK union is defined over sets, not numbers, so I'm not sure what you > mean by th

Re: ZipFile and file rigths

2005-07-10 Thread perchef
ok thanks, it works even if it's a little bit dirty. -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread James Dennett
Pete Barrett wrote: > On 10 Jul 2005 02:57:04 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: > > >>Similarly, in computer languages, expressiveness is significant with >>respect to semantics, not syntactical variation. >> > > It may just be me, but I tend to think of a computer language as a > too

Re: Defending Python

2005-07-10 Thread Bruno Desthuilliers
Jorey Bump a écrit : > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in > news:[EMAIL PROTECTED]: > > >>Grant Edwards a écrit : >> >>>On 2005-07-09, Brian <[EMAIL PROTECTED]> wrote: >>> >>> >>> >folks as an easily acquired extra skill. I agree 100% with your statement above. Python

Re: An absolute Newbie question

2005-07-10 Thread wpog
WOW!!! I really appreciate the immediate response from the community!!! I thank you all for all the help, and now I can start programming, and I also now have a resource for help for a Newbie;-) Later on I will broach the subject of creating .exe programs so that anyone can run them on Windows

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Keith Thompson
"Xah Lee" <[EMAIL PROTECTED]> writes: > What is Expresiveness in a Computer Language > > 20050207, Xah Lee. +---+ .:\:\:/:/:. | PLEASE DO NOT |:.:\:\:/:/:.: | FEED THE TROLLS | :=.' - - '.=: |

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Terry Reedy
"Bengt Richter" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > The binding of a class name is similar, and class decorators > would seem natural, i.e., > >@cdeco >class Foo: pass > for >class Foo: pass >Foo = cdeco(Foo) This possibility was discussed on the py-dev

Re: Efficiency of using long integers to hold bitmaps

2005-07-10 Thread Bengt Richter
On Mon, 11 Jul 2005 02:37:21 +1000, "Jeff Melvaine" <[EMAIL PROTECTED]> wrote: >I note that I can write expressions like "1 << 100" and the result is stored >as a long integer, which means it is stored as an integer of arbitrary >length. I may need to use a large number of these, and am interes

Re: Use cases for del

2005-07-10 Thread Terry Reedy
"Ron Adam" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > To avoid that you either need to define the flag string as a global name > or use it strictly in the local scope it's defined in. Python will also > sometimes reuse strings as an optimization instead of creating a second >

Re: Defending Python

2005-07-10 Thread Jorey Bump
Bruno Desthuilliers <[EMAIL PROTECTED]> wrote in news:[EMAIL PROTECTED]: > Jorey Bump a écrit : >> Bruno Desthuilliers <[EMAIL PROTECTED]> wrote >> in news:[EMAIL PROTECTED]: >> >>>Grant Edwards a écrit : >>> On 2005-07-09, Brian <[EMAIL PROTECTED]> wrote: >>folks as an easily acqui

RE: Yet Another Python Web Programming Question

2005-07-10 Thread Robert Brewer
Paul Boddie wrote: > "Robert Brewer" <[EMAIL PROTECTED]> wrote in message > news:<[EMAIL PROTECTED]>... > > Daniel Bickett wrote: > > > I neglected to mention an important fact, and that is the > > > fact that I am limited to Apache, which elminates several > > > suggestions (that are appreciated

Re: ZipFile and file rigths

2005-07-10 Thread Sybren Stuvel
perchef enlightened us with: > it works well but i have a small problem : i can't see how i can > deal with file rights. When I unzip files with this script all the > unzipped files haven't the good rights. That's right. Why should they? ZIP doesn't store file permissions. > ZipInfo objects does

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Terry Reedy
"Ralf W. Grosse-Kunstleve" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] I have a suggestion I don't remember seeing for flagging which vars to autoinit without new syntax: use '_' instead of '.'. I have never seen local vars with a leading '_'. So, in combination with whatever

Re: Yet Another Python Web Programming Question

2005-07-10 Thread Sybren Stuvel
Daniel Bickett enlightened us with: > It would be a long while before he would find Python, and since that > time he would have no desire to ever touch PHP again. My thoughts exactly. > He would, however, be compelled to write a web application again, > but in Python now, of course. Same here :)

Re: Should I use "if" or "try" (as a matter of speed)?

2005-07-10 Thread Sybren Stuvel
Steve Juranich enlightened us with: > Without fail, when I start talking with some of the "old-timers" > (people who have written code in ADA or Fortran), I hear the same > arguments that using "if" is "better" than using "try". Then here is the counter argument: - Starting a 'try' is, as said s

Read-only class properties

2005-07-10 Thread George Sakkis
I'm trying to write a decorator similar to property, with the difference that it applies to the defining class (and its subclasses) instead of its instances. This would provide, among others, a way to define the equivalent of class-level constants: class Foo(object): @classproperty def The

Re: computer algebra packages

2005-07-10 Thread Robert Kern
François Pinard wrote: > [Florian Diesch] >>Description: A user-friendly frontend for MAXIMA >> Mascyma is (trying to be) a user-friendly graphical frontend for the Computer >> Algebra System GNU MAXIMA. It is written in Python and provides two GUIs, >> one of which based on PyGTK, the other base

Re: Another newbie question from Nathan.

2005-07-10 Thread johng2001
Nathan Pinno wrote: > Hi all, > > How do I make Python get a def? Is it the "get" function, or something > else? I need to know so that I can get a def for that computer > MasterMind(tm) game that I'm writing. > > BTW, I took your advice, and wrote some definitions for my Giant > Calculator pro

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Bengt Richter
On Sun, 10 Jul 2005 05:35:01 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: >> ;-) >> We have > >Have we? > >Looks like not a lot of interested takers so far. > >But I'll bite. ;-) > > > > >> So why not >> >> @deco >> foo = lambda:pass >> equivalent to >> foo = deco(la

Re: ZipFile and file rigths

2005-07-10 Thread Robert Kern
perchef wrote: > hi, > > i have written this small code which allow me to unzip files using > python : > > import zipfile > import os > import os.path > > pathDir="/home/toto/Desktop" > pathZip= os.path.join(pathDir,"foobar.zip") > > if zipfile.is_zipfile(pathZip): > zf = zipfile.ZipFile(pa

Re: Defending Python

2005-07-10 Thread Peter Hansen
Jorey Bump wrote: > Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: >>it's. > > +1 for this becoming the official name of Python 3000. ;) > > And now for something completely different... > > The larch! Sorry, already taken: '''Larch - John Guttag and Jim Horning <[EMAIL PROTECTED]>. The Larch

inheritance

2005-07-10 Thread J
Hi I am trying to make a C++ class hierarchy accessible to python scripts. Am I right to assume that the type structure of a derived class must have all the members of its base class declared as well ? For example, typedef struct { PyObject_HEAD int someb

Re: Python Module Exposure

2005-07-10 Thread George Sakkis
"Jacob Page" <[EMAIL PROTECTED]> wrote: > OK, you've convinced me now to support and, or, and xor between every > combination of Intervals and IntervalSets, Intervals and IntervalSets, > and IntervalSets and Intervals. I'm sorry, this was not my intention . > However, I'm not sure I like the id

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Kenny McCormack
In article <[EMAIL PROTECTED]>, Pete Barrett <[EMAIL PROTECTED]> wrote: >On 10 Jul 2005 02:57:04 -0700, "Xah Lee" <[EMAIL PROTECTED]> wrote: > >>Similarly, in computer languages, expressiveness is significant with >>respect to semantics, not syntactical variation. >> >It may just be me, but I tend

Re: computer algebra packages

2005-07-10 Thread François Pinard
[Robert Kern] > François Pinard wrote: > > [Florian Diesch] > >> Mascyma is (trying to be) a user-friendly graphical frontend for > >> the Computer Algebra System GNU MAXIMA. It is written in Python > >> and provides two GUIs, one of which based on PyGTK, the other based > >> on wxPython. > > I

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Matthias Buelow
Steven D'Aprano <[EMAIL PROTECTED]> writes: >On Sun, 10 Jul 2005 07:20:34 -0700, raptor wrote: > >> I think u are wrong.. I think perl is much more exrpressive in >> semantics than Python.. > >Well, with such great command of natural language as you are displaying, >how could anyone argue with you

Re: An absolute Newbie question

2005-07-10 Thread Justin Straube
wpog wrote: > I have a question about using "IDLE", and that is whenever I start write my > own program in the "Python Shell" it will automatically execute whatever > command I have written, for example: >>> print 'Hello World" > > So, how to I get it to not execute, so that I can write a prog

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread George Sakkis
"Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Bengt Richter" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > The binding of a class name is similar, and class decorators > > would seem natural, i.e., > > > >@cdeco > >class Foo: pass > > for > >class Foo: pass > >Foo

Re: ZipFile and file rigths

2005-07-10 Thread perchef
> ZIP doesn't store file permissions. ok, but in that case how could stuffit retrieve these permissions ? Thanks for the link Robert. -- http://mail.python.org/mailman/listinfo/python-list

AST decoration vs byte-code-munging (Was: Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code))

2005-07-10 Thread Bengt Richter
On Sun, 10 Jul 2005 16:26:24 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > >"Ralf W. Grosse-Kunstleve" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] > >I have a suggestion I don't remember seeing for flagging which vars to >autoinit without new syntax: use '_' instead of '.'.

Re: ZipFile and file rigths

2005-07-10 Thread Robert Kern
perchef wrote: [Sybren Stuvel:] >>ZIP doesn't store file permissions. Yes, the .zip file format does store file permissions appropriate to the platform that generates the file. > ok, but in that case how could stuffit retrieve these permissions ? > > Thanks for the link Robert. When one makes

Re: Codecs

2005-07-10 Thread Martin v. Löwis
Ivan Van Laningham wrote: > Hi All-- > As far as I can tell, after looking only at the documentation (and not > searching peps etc.), you cannot query the codecs to give you a list of > registered codecs, or a list of possible codecs it could retrieve for > you if you knew enough to ask for them by

Re: computer algebra packages

2005-07-10 Thread Bengt Richter
On Sun, 10 Jul 2005 13:12:21 -0400, =?iso-8859-1?Q?Fran=E7ois?= Pinard <[EMAIL PROTECTED]> wrote: >[Florian Diesch] > >> Probably this is usable for you (I never used any of them): > >> This system MAXIMA is [...] based on the original implementation of >> Macsyma at MIT [...] > >Wow! A deriva

Re: computer algebra packages

2005-07-10 Thread Robert Kern
Bengt Richter wrote: > Then googling for mascsyma [sic ;-)] got I doubt it. ;-) -- Robert Kern [EMAIL PROTECTED] "In the fields of hell where the grass grows high Are the graves of dreams allowed to die." -- Richard Harter -- http://mail.python.org/mailman/listinfo/python-list

Re: Efficiency of using long integers to hold bitmaps

2005-07-10 Thread Martin v. Löwis
Bengt Richter wrote: > Sounds like a possible^H^H^H^H^H^H^H^Hprobable premature optimization worry > ;-) Right. OTOH, I notice a frequent game of Katze und Maus (cat and mouse?) in questions around Python implementation details. The OP doesn't provide details of his application, but instead asks

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Dan Sommers
On Sun, 10 Jul 2005 16:26:24 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Ralf W. Grosse-Kunstleve" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > I have a suggestion I don't remember seeing for flagging which vars to > autoinit without new syntax: use '_' instead of '.'.

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Paul Rubin
Dan Sommers <[EMAIL PROTECTED]> writes: > def __init__(self, self.x, y, self.z): > # self.x, self.z from first and third explicit parameters > do_something_with_y() Hey, I like that. -- http://mail.python.org/mailman/listinfo/python-list

Re: inheritance

2005-07-10 Thread J
just to follow up. I managed to get it working by having a closer look at the xxmodules. However, the example does the following typedef struct { PyStructBaseClass mBase; int mValue; } PyStructDerivedClass; Does anything speak agains doing this ?

Cat and Mouse (wes Re: Efficiency of using long integers to hold bitmaps)

2005-07-10 Thread Terry Reedy
""Martin v. Löwis"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Right. OTOH, I notice a frequent game of Katze und Maus (cat and mouse?) Yes, apparently with the same idiomatic meaning, as you decribe the game here perfectly. TJR -- http://mail.python.org/mailman/listinfo

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Terry Reedy
"George Sakkis" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> This possibility was discussed on the py-dev list about a year or so >> ago. >> The twice monthly summaries should include this topic. As I remember, >> the >> reason for l

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Terry Reedy
"Dan Sommers" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Sun, 10 Jul 2005 16:26:24 -0400, > "Terry Reedy" <[EMAIL PROTECTED]> wrote: >> I have a suggestion I don't remember seeing for flagging which vars to >> autoinit without new syntax: use '_' instead of '.'. I have neve

Re: Codecs

2005-07-10 Thread John Machin
Ivan Van Laningham wrote: > > It seems to me that if I want to try to read an unknown file > using an exhaustive list of possible encodings ... Supposing such a list existed: What do you mean by "unknown file"? That the encoding is unknown? Possibility 1: You are going to try to decode the fil

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Dan Sommers
On Sun, 10 Jul 2005 20:11:38 -0400, "Terry Reedy" <[EMAIL PROTECTED]> wrote: > "Dan Sommers" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> That's a pretty big change; now all formal parameters beginning with >> an underscore have a brand new meaning. > As I said, 'in combinat

Re: removing list comprehensions in Python 3.0

2005-07-10 Thread EP
> Well, I want to offer a more radical proposal: why not free squared > braces from the burden of representing lists at all? It should be > sufficient to write > > >>> list() > list() > >From a visual comprehenison point of view, I would assert that the square form >[] is much easier on the

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Casey Hawthorne
It is easier to write code a computer can understand than others can understand! It is harder to read code than to write code! -- Regards, Casey -- http://mail.python.org/mailman/listinfo/python-list

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Ramon F Herrera
[Peter Barret wrote:] > It may just be me, but I tend to think of a computer language as a > tool for directing computers to perform specific actions. Do we talk > about the expressiveness of a spade? yes, it is just you. :-) Your comparison is a very poor match. How can you even begin to compa

Re: decorators as generalized pre-binding hooks

2005-07-10 Thread Ron Adam
Bengt Richter wrote: > On Sun, 10 Jul 2005 05:35:01 GMT, Ron Adam <[EMAIL PROTECTED]> wrote: >>So far they are fairly equivalent. So there's not really any advantage >>over the equivalent inline function. But I think I see what you are >>going towards. Decorators currently must be used when a

Re: Read-only class properties

2005-07-10 Thread Bengt Richter
On 10 Jul 2005 13:38:22 -0700, "George Sakkis" <[EMAIL PROTECTED]> wrote: >I'm trying to write a decorator similar to property, with the >difference that it applies to the defining class (and its subclasses) >instead of its instances. This would provide, among others, a way to >define the equivale

Re: computer algebra packages

2005-07-10 Thread Bengt Richter
On Sun, 10 Jul 2005 15:53:22 -0700, Robert Kern <[EMAIL PROTECTED]> wrote: >Bengt Richter wrote: > >> Then googling for mascsyma [sic ;-)] got Dang, and I put "[sic]" too. IOW, 'macsyma'.replace('cs','sc') > >I doubt it. ;-) > Rightly ;-/ Fingers think they know spelling better than I do ;-/ Reg

Re: __autoinit__ (Was: Proposal: reducing self.x=x; self.y=y; self.z=z boilerplate code)

2005-07-10 Thread Bengt Richter
On 10 Jul 2005 16:07:40 -0700, Paul Rubin wrote: >Dan Sommers <[EMAIL PROTECTED]> writes: >> def __init__(self, self.x, y, self.z): >> # self.x, self.z from first and third explicit parameters >> do_something_with_y() > >Hey, I like that. Me too. I l

Re: What is Expresiveness in a Computer Language?

2005-07-10 Thread Randy Howard
Keith Thompson wrote (in article <[EMAIL PROTECTED]>): >\/| |\| __\,,\ /,,/__ > \||/ | | | jgs (__Y__) > /\/\/\/\/\/\/\/\//\/\\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\ > ==

Re: Efficiency of using long integers to hold bitmaps

2005-07-10 Thread jepler
You'll find that using Python Longs unsuitable if you *change* the bitmaps---All numeric types are immutable, so you'll copy the bitmap each time you perform an operation like "set bit". numarray has a 'bit' typecode, though I'm not sure how such an array is actually stored---from a quick look, it

  1   2   >