Re: Multiple constructors

2005-02-06 Thread Reinhold Birkenfeld
vincent wehren wrote: Philip Smith wrote: Call this a C++ programmers hang-up if you like. I don't seem to be able to define multiple versions of __init__ in my matrix class (ie to initialise either from a list of values or from 2 dimensions (rows/columns)). Even if Python couldn't

Re: Python versus Perl ?

2005-02-06 Thread Reinhold Birkenfeld
[EMAIL PROTECTED] wrote: I've read some posts on Perl versus Python and studied a bit of my Python book. I'm a software engineer, familiar with C++ objected oriented development, but have been using Perl because it is great for pattern matching, text processing, and automated testing. Our

Re: default value in a list

2005-01-22 Thread Reinhold Birkenfeld
Michael Spencer wrote: Alex Martelli wrote: [explanation and the following code:] a, b, c = it.islice( ... it.chain( ... line.split(':'), ... it.repeat(some_default), ... ), ... 3) ... ...

Re: default value in a list

2005-01-22 Thread Reinhold Birkenfeld
Nick Coghlan wrote: Reinhold Birkenfeld wrote: Why not put these together and put it in itertools, since the requirement seems to crop up every other week? line = A:B:C.split(:) ... def ipad(N,iterable, default = None): ... return it.islice(it.chain(iterable, it.repeat(default

Re: make install with python

2005-01-21 Thread Reinhold Birkenfeld
Uwe Mayer wrote: Hi, I am writing a Python application and use the GNU auto-tools to compile what needs compilation (i.e. Qt's .ui files). However, I don't know how to write an automake file that installs the main file (lmc.py) and some library files (i.e. ClassA.py, ClassB.py) into the

What YAML engine do you use?

2005-01-20 Thread Reinhold Birkenfeld
Hello, I know that there are different YAML engines for Python out there (Syck, PyYaml, more?). Which one do you use, and why? For those of you who don't know what YAML is: visit http://yaml.org/! You will be amazed, and never think of XML again. Well, almost. Reinhold --

Re: [perl-python] 20050118 keyed list

2005-01-18 Thread Reinhold Birkenfeld
Jay Tilton wrote: : # the syntax of keyed list in Perl is too complex : # to be covered in a short message. JFTR: keyed lists are called dictionaries in Python. [1]Message-ID: [EMAIL PROTECTED] This guy's wish-wash is starting to be funny, after all! Reinhold --

Re: [perl-python] 20050118 keyed list

2005-01-18 Thread Reinhold Birkenfeld
Jürgen Exner wrote: © # see perldoc perldata for an unix-styled course. Excuse me? Do you mind explaining where exactly perldata is Unix-styled? Remember: Perl == Unix == Satan. Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: Assigning to self

2005-01-17 Thread Reinhold Birkenfeld
Frans Englich wrote: Hello, I am having trouble with throwing class instances around. Perhaps I'm approaching my goals with the wrong solution, but here's nevertheless a stripped down example which demonstrates my scenario:

Re: Why would I get a TypeEror?

2005-01-14 Thread Reinhold Birkenfeld
Steven Bethard wrote: It's me wrote: Say again??? Please stop top-posting -- it makes it hard to reply in context. Reinhold Birkenfeld wrote... It's me wrote: If this is true, I would run into trouble real quick if I do a: (1/x,1.0e99)[x==0] Lazy evaluation: use the (x==0 and 1e99 or 1/x

Re: Free python server.

2005-01-13 Thread Reinhold Birkenfeld
Kartic wrote: And yes, they have python installed... Python 2.1! Reinhold -- http://mail.python.org/mailman/listinfo/python-list

Re: reference or pointer to some object?

2005-01-13 Thread Reinhold Birkenfeld
Torsten Mohr wrote: Hi, Could you give us a more concrete use case? My suspicion is that anything complicated enough to be passed to a method to be modified will probably be more than a simple int, float, str or tuple... In which case, it will probably have methods to allow you to update

Re: else condition in list comprehension

2005-01-09 Thread Reinhold Birkenfeld
Matteo Dell'Amico wrote: Luis M. Gonzalez wrote: Hi there, I'd like to know if there is a way to add and else condition into a list comprehension. I'm sure that I read somewhere an easy way to do it, but I forgot it and now I can't find it... for example: z=[i+2 for i in range(10) if

Re: ? about file() and open()

2005-01-03 Thread Reinhold Birkenfeld
Sean wrote: Was wondering if there was any difference between these two functions. I have read some text that said file() wasn't introduced until 2.2 and that it was synonymous with open(). Does this mean that I should be using file() where I used open() before? FYI, I submitted a patch to

Re: What can I do with Python ??

2005-01-02 Thread Reinhold Birkenfeld
Jabaru wrote: BTW, I don't know of a way to write fullscreen games in C#... Directx, Opengl, Gdi+, win32api, SDL... the list goes on Yes, that's right, but most of those you can use in Python, too. I should have inserted the word specific at the right point in my sentence wink Reinhold --

Re: Looping using iterators with fractional values

2005-01-01 Thread Reinhold Birkenfeld
drife wrote: Hello, Making the transition from Perl to Python, and have a question about constructing a loop that uses an iterator of type float. How does one do this in Python? In Perl this construct quite easy: for (my $i=0.25; $i=2.25; $i+=0.25) { printf %9.2f\n, $i; } =Py2.3:

Re: Looping using iterators with fractional values

2005-01-01 Thread Reinhold Birkenfeld
Mike Meyer wrote: Or - and much safer when dealing with floating point numbers - iterate over integers and generate your float values: for j in range(1, 9): i = j * .25 print %9.2f % i There's a glitch there, though - should be range(1, 10). Reinhold PS: I'm wondering whether my

Re: Speed ain't bad

2004-12-31 Thread Reinhold Birkenfeld
Craig Ringer wrote: On Fri, 2004-12-31 at 11:17, Jeremy Bowers wrote: I would point out a couple of other ideas, though you may be aware of them: Compressing all the files seperately, if they are small, may greatly reduce the final compression since similarities between the files can not be

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
Freddie wrote: Happy new year! Since I have run out of alcohol, I'll ask a question that I haven't really worked out an answer for yet. Is there an elegant way to turn something like: moo cow farmer john -zug into: ['moo', 'cow', 'farmer john'], ['zug'] I'm trying to parse a

Re: Parsing a search string

2004-12-31 Thread Reinhold Birkenfeld
M.E.Farmer wrote: Ah! that is what the __future__ brings I guess. Damn that progress making me outdated ;) Python 2.2.3 ( a lot of extensions I use are stuck there , so I still use it) I'm also positively surprised how many cute little additions are there every new Python version.

Re: what is lambda used for in real code?

2004-12-31 Thread Reinhold Birkenfeld
Adam DePrince wrote: So, those are my thoughts on how lambdas are really used. If others out there have real-life code that uses lambdas in interesting ways, feel free to share them here! Lets not forget the real reason for lambda ... I really hoped you would point out the _real_

Re: Why tuples use parentheses ()'s instead of something else like 's?

2004-12-30 Thread Reinhold Birkenfeld
Alex Martelli wrote: Jeff Shannon [EMAIL PROTECTED] wrote: ... to remember and type some arcane alt-keycode formula to be able to do basic scripting would be obnoxious, to say the least. Most keyboards worldwide provide decent support for the ASCII character set (though some add a few

Re: Why tuples use parentheses ()'s instead of something else like 's?

2004-12-29 Thread Reinhold Birkenfeld
Roy Smith wrote: John Roth [EMAIL PROTECTED] wrote: If Python had originally been invented in a unicode world, I suppose we wouldn't have this problem. We'd just be using guillemots for tuples (and have keyboards which made it easy to type them). I suppose the forces of darkness will

Re: Why tuples use parentheses ()'s instead of something else like 's?

2004-12-29 Thread Reinhold Birkenfeld
Grant Edwards wrote: On 2004-12-29, Reinhold Birkenfeld [EMAIL PROTECTED] wrote: Perl6 experiments with the use of guillemots as part of the syntax. As if Perl didn't look like bird-tracks already... http://www.seabird.org/education/animals/guillemot.html http://www.birdguides.com/html

Re: input record sepArator (not sepErator)

2004-12-21 Thread Reinhold Birkenfeld
Peter Otten wrote: Terry Reedy wrote: 'separate' (se-parate == take a-part) and its derivatives are perhaps the most frequently misspelled English word on clp. Seems to be 'par' for the course. It has 2 e's bracketing 2 a's. It derives from the Latin 'parare', as does pare, so 'par' is

Re: input record sepArator (not sepErator)

2004-12-21 Thread Reinhold Birkenfeld
Peter Otten wrote: Reinhold Birkenfeld wrote: the web: 4% python: 9% slashdot: 26% perl: 29% * How did you get these data points? I copied the numbers from these pages: http://www.google.com/search?q=separate http://groups-beta.google.com/group/comp.lang.python/search?group

Re: What is on-topic for the python list [was Re: BASIC vs Python]

2004-12-21 Thread Reinhold Birkenfeld
Doug Holton wrote: Hans Nowak wrote: Quote: this is comp.lang.python, not comp.lang.boo. Which is obviously not the same as Boo should not be mentioned on this newsgroup. I used the exact same phrase in another note except using the term logo instead of boo, and that is the exact

<    1   2   3