Re: Alternatives to Stackless Python?

2005-09-23 Thread Christophe
[EMAIL PROTECTED] a écrit : >>I found LGT http://lgt.berlios.de/ but it didn't seem as if the >>NanoThreads module had the same capabilites as stackless. > > > What specific capabilities of Stackless are you looking for, that are > missing from NanoThreads? Capabilities of the different "threadl

Re: Alternatives to Stackless Python?

2005-09-23 Thread Christophe
Olivier Dormond a écrit : > Christophe wrote: > >> [EMAIL PROTECTED] a écrit : >> >>>> I found LGT http://lgt.berlios.de/ but it didn't seem as if the >>>> NanoThreads module had the same capabilites as stackless. >>> >>> >>

Re: What does pygame.Movie mean by `an MPEG file'?

2005-09-28 Thread Christophe
Kilian A. Foth a écrit : > I just found this amazing video puzzle game written with the pygame > library, which promises to be infinite fun - but I can't get it to > decode any video file I own, except the game's own example .mpg. All I > have is lots and lots of useless .avi, .mp2, .wmv, and so on

Re: Will python never intend to support private, protected and public?

2005-09-28 Thread Christophe
Steven D'Aprano a écrit : > For some reason, the original post never made it to my newsreader, so > apologies for breaking threading by replying to a reply when I mean to > answer the original post. > > On Wed, 28 Sep 2005 12:05:21 +0100, Simon Brunning wrote: > > >>On 9/28/05, could ildg <[EMAI

Re: [Info] PEP 308 accepted - new conditional expressions

2005-10-03 Thread Christophe
Michael a écrit : > Rocco Moretti wrote: > > >>That is, what would happen with the following constructs: >> >>A if B else C if D else F >>A if B if C else D else F > > > The correct answer should be the person who wrote it would get told off > for writing code that a person reading would have n

Re: "no variable or argument declarations are necessary."

2005-10-03 Thread Christophe
Steven D'Aprano a écrit : > On Mon, 03 Oct 2005 06:59:04 +, Antoon Pardon wrote: > > >>Well I'm a bit getting sick of those references to standard idioms. >>There are moments those standard idioms don't work, while the >>gist of the OP's remark still stands like: >> >> egold = 0: >> while e

Re: So far

2005-10-06 Thread Christophe
CppNewB a écrit : > I am absolutely loving my experience with Python. Even vs. Ruby, the syntax > feels very clean with an emphasis on simplification. > > My only complaint is that there doesn't appear to be a great commercial IDE > for the language. I've tried Komodo, etc and they are nice ap

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Christophe
Roy Smith a écrit : > There's more to it than just that. Python's type checking is not just not > done at compile time, it's done as late in run time as possible. One might > call it just-in-time type checking. It's more of a "Nearly too late" type checking I would say. Not that I complain bu

Re: "no variable or argument declarations are necessary."

2005-10-07 Thread Christophe
Fredrik Lundh a écrit : > "Christophe" wrote: > > >>It's more of a "Nearly too late" type checking I would say. Not that I >>complain but it would be great if there were also some automatic type >>checking to catch a few errors as soon as

Re: passing variable arguments to a function

2005-10-13 Thread Christophe
Ryan Wilcox a écrit : > Hello all, > > I want to be able to pass a variable number of parameters into a Python > function. Now, I know how to _receive_ variable arguments, but I don't > know how to _send_ them. > > def myFunction(*args): > print args > > myList = [1, 2, 3, 4] > myFunction(my

Re: Yes, this is a python question, and a serious one at that (moving to Win XP)

2005-10-14 Thread Christophe
Kenneth McDonald a écrit : > For unfortunate reasons, I'm considering switching back to Win XP (from > OS X) as my "main" system. Windows has so many annoyances that I can > only compare it to driving in the Bay Area at rush hour (OS X is like > driving in Portland at rush hour--not as bad, b

Re: Question on class member in python

2005-10-18 Thread Christophe
Johnny Lee a écrit : > Alex Martelli 写道: > > >>Johnny Lee <[EMAIL PROTECTED]> wrote: >> >> >>>But I still wonder what's the difference between the A().getMember and >>>A().member besides the style >> >>Without parentheses after it, getMember is a method. The difference >>between a method object

Re: UI toolkits for Python

2005-10-18 Thread Christophe
Mike Meyer a écrit : > [EMAIL PROTECTED] (Alex Martelli) writes: > >>Maybe that's the key difference between the mindset of a >>mathematician and that of an engineer -- I consider reaching over >>95% of visitors to be _quite good indeed_, > > > Oh? So you'd consider an SMTP/IMAP/POP/DNS/NFS/etc

Re: UI toolkits for Python

2005-10-18 Thread Christophe
Mike Meyer a écrit : > [EMAIL PROTECTED] (Alex Martelli) writes: > >>Maybe that's the key difference between the mindset of a >>mathematician and that of an engineer -- I consider reaching over >>95% of visitors to be _quite good indeed_, > > > Oh? So you'd consider an SMTP/IMAP/POP/DNS/NFS/etc

Re: wxPython Licence vs GPL

2005-11-25 Thread Christophe
Ed Jensen a écrit : >>Well, despite your protestations, I think the GPL and LGPL are fairly >>easy and safe choices for a lot of developers who know enough about >>Free Software (ie. haven't just seen the name and thought "that's the >>thing for me"), know what the characteristics of those licences

Re: Death to tuples!

2005-11-30 Thread Christophe
Antoon Pardon a écrit : > On 2005-11-30, Duncan Booth <[EMAIL PROTECTED]> wrote: > >>Antoon Pardon wrote: >> >>>But lets just consider. Your above code could simply be rewritten >>>as follows. >>> >>> res = list() >>> for i in range(10): >>> res.append(i*i) >>> >> >>I don't understand your p

Re: Is there no compression support for large sized strings in Python?

2005-12-01 Thread Christophe
Gerald Klix a écrit : > Did you consider the mmap library? > Perhaps it is possible to avoid to hold these big stings in memory. > BTW: AFAIK it is not possible in 32bit windows for an ordinary programm > to allocate more than 2 GB. That restriction comes from the jurrasic > MIPS-Processors, that

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-02 Thread Christophe
infidel a écrit : >>I'm using the Windows version of Python and IDLE. When I debug my .py >>file, my modification to the .py file does not seem to take effect >>unless I restart IDLE. Saving the file and re-importing it doesn't help >>either. Where's the problem? > > > "import" only reads the fil

Re: Why my modification of source file doesn't take effect whendebugging?

2005-12-05 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > > >>>"import" only reads the file the first time it's called. Every import >>>call after that looks up the module in memory. This is to prevent >>>circular dependencies between modules from cre

Re: Why my modification of source file doesn't take effectwhendebugging?

2005-12-05 Thread Christophe
Fredrik Lundh a écrit : > "Christophe" wrote: > > >>F5 is designed to run the current open file. Sane people won't assume >>that pressing twice the F5 key will yield different. Sane people will >>assume that when you edit file1.py and press F5, it repar

Re: Why my modification of source file doesn't take effect when debugging?

2005-12-05 Thread Christophe
Dave Hansen a écrit : > On Fri, 02 Dec 2005 18:04:15 +0100 in comp.lang.python, Christophe > <[EMAIL PROTECTED]> wrote: > > >>infidel a écrit : >> >>>>I'm using the Windows version of Python and IDLE. When I debug my .py >>>>file, m

Re: Tabs bad

2005-12-06 Thread Christophe
Paul McNett a écrit : > Björn Lindström wrote: > >> Paul Rubin writes: >> >> >>> [EMAIL PROTECTED] (Björn Lindström) writes: >>> Actually using tabs for eight spaces and then filling out with spaces to the correct indentation is the convention for Emacs L

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-06 Thread Christophe
Zeljko Vrba a écrit : > On 2005-12-02, Micah Elliott <[EMAIL PROTECTED]> wrote: > >>On Dec 02, Dave Hansen wrote: >> >>>Python recognizes the TAB character as valid indentation. TAB >>>characters are evil. They should be banned from Python source code. >> >>AGREE! AGREE! AGREE! >> > > The da

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-07 Thread Christophe
Paul Rubin a écrit : > Antoon Pardon <[EMAIL PROTECTED]> writes: > >>But lately I have been wondering about doing the following: >>end = None >>... >> if ...: >>... >> end >>IMO it looks better, but I'm reluctant because it suggest >>some checking by the compilor, which just doesn't happen.

Re: ANN: Dao Language v.0.9.6-beta is release!

2005-12-09 Thread Christophe
David Rasmussen a écrit : > Antoon Pardon wrote: > >>> >>> Write shorter functions ;) >> >> >> This has little to do with long functions. A class can contain >> a large number of methods, whitch are all rather short, and your >> class will still be spread over several pages. >> > > Write classes

Re: pretty windows installer for py scripts

2005-09-08 Thread Christophe
rbt a écrit : > Any recommendations on a windows packager/installer that's free? I need > it to allow non-tech users to install some python scripts... you know, > "Click Next"... "Click Next"... "Click Finish"... "You're Done!" and > everything just magically works ;) Isn't that already available

Re: pretty windows installer for py scripts

2005-09-08 Thread Christophe
Paul Rubin a écrit : > Christophe <[EMAIL PROTECTED]> writes: > >>>Any recommendations on a windows packager/installer that's free? I need >>>it to allow non-tech users to install some python scripts... you know, >>>"Click Next"..

Re: Inconsistent reaction to extend

2005-09-09 Thread Christophe
Antoon Pardon a écrit : >>Because creating a new list is potentially very time-consuming and >>expensive of memory. Imagine you have a list of 100,000 large objects, and >>you want to add one more object to it. The way Python works is that append >>and extend simply add that new object to the end o

Re: help in simplification of code [string manipulation]

2005-09-13 Thread Christophe
John a écrit : > How could I simplify the code to get libs out of LDFLAGS > or vice versa automatically in the following python/scons code? > > if sys.platform[:5] == 'linux': > env.Append (CPPFLAGS = '-D__LINUX') > env.Append (LDFLAGS = '-lglut -lGLU -lGL -lm') > env.Append(CPP

Re: PyGTK or wXPython?

2005-09-13 Thread Christophe
Peter Decker a écrit : > On 9/13/05, Rod W <[EMAIL PROTECTED]> wrote: > >>I'm just starting out on Python but my primary goal is to provide >>applications with some user interface (GUI). >> >>Can someone point me to a good comparison of whether I should use >>wxPython (with wxGlade I assume) or Py

Re: help in simplification of code [string manipulation]

2005-09-14 Thread Christophe
a scons function. > Christophe wrote: > >>John a écrit : >> >>>How could I simplify the code to get libs out of LDFLAGS >>>or vice versa automatically in the following python/scons code? >>> >>>if sys.platform[:5] == 'linux': >>>

Re: 32bit install on 64bit system

2005-09-15 Thread Christophe
Peter Hartmann a écrit : > Hello, > I could really use some help. I'm trying to install a python program > on centos4 x86_64. When I run 'python setup.py' it ends up in > /usr/lib64/python2.3/site-packages/ instead of > /usr/lib/python2.3/site-packages. It's a problem because the program > I'm

Re: IDE, widget library

2005-09-19 Thread Christophe
Alessandro Bottoni a écrit : > Try wxPython (Based on wxWidgets). Really "free" (LGPL'ed = MIT license) on > all platforms, well-engineered, documented and supported, native look&feel > on all platform. Need anything else? ;-) Some people have that weird notion that GTK is native look and feel on

Re: p2exe using wine/cxoffice

2005-09-19 Thread Christophe
Tim Roberts a écrit : > James Stroud <[EMAIL PROTECTED]> wrote: > >>I think the motivation is to ween people off of M$ products altogether, > > > Well, CrossOver Office doesn't really do that. You're still running > Microsoft Office. > > >>...to get >>them used to working an a unix environm

Re: C#3.0 and lambdas

2005-09-19 Thread Christophe
Wolfgang Langner a écrit : > Hello, > >> "Is anyone truly attached to nested tuple function parameters; 'def >> fxn((a,b)): print a,b'? /.../ >> >> Would anyone really throw a huge fit if they went away? I am willing >> to write a PEP for their removal in 2.6 with a deprecation i

Re: C#3.0 and lambdas

2005-09-19 Thread Christophe
Max M a écrit : > Steven D'Aprano wrote: > >> On Mon, 19 Sep 2005 10:31:48 +0200, Fredrik Lundh wrote: >> >> How many items should you pass in the tuple? If it takes variable >> arguments, then that works, but if you always expect a fixed number, then >> >> def func((x, y)) >> >> is more explicit.

Re: C#3.0 and lambdas

2005-09-21 Thread Christophe
Serhiy Storchaka a écrit : > Roel Schroeven wrote: > >> Fredrik Lundh schreef: >> >>> meanwhile, over in python-dev land: >>> >>>"Is anyone truly attached to nested tuple function parameters; 'def >>>fxn((a,b)): print a,b'? /.../ >>> >>>Would anyone really throw a huge fit if they wen

Re: C#3.0 and lambdas

2005-09-21 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > > >>> def drawline(p1, p2): >>> # draw a line from p1 to p2 >>> foo(*p1) >>> bar(*p2) >>> >> >>That one is stupid. I don't see how you can make it work without some &g

Re: C#3.0 and lambdas

2005-09-21 Thread Christophe
Steve Holden a écrit : > Christophe wrote: > >> Serhiy Storchaka a écrit : >> >>> Roel Schroeven wrote: > > [...] > >>>> or >>>> >>>> def drawline(p1, p2): >>>># draw a line from p1[0], p1[1] to p2[0], p2[1]

Re: C#3.0 and lambdas

2005-09-21 Thread Christophe
Steve Holden a écrit : > Christophe wrote: > >> Steve Holden a écrit : >> >>> Christophe wrote: >>> >>> >>>> Serhiy Storchaka a écrit : >>>> >>>> >>>>> Roel Schroeven wrote: >>> >>>

Re: C#3.0 and lambdas

2005-09-21 Thread Christophe
Dennis Lee Bieber a écrit : > On Wed, 21 Sep 2005 17:08:14 +0200, Christophe <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > > >>No unpack trick ( that I know of ) can be used here. You only have 1 way >>to do it without the unp

Re: C#3.0 and lambdas

2005-09-22 Thread Christophe
Steven Bethard a écrit : > Steven D'Aprano wrote: > >> I would love to see your test code and profiling results that demonstrate >> that explicit tuple unpacking in the body of a function is faster than >> tuple unpacking (implicit or explicit) in the header of a function. > > > Should be pretty

Re: putenv

2005-12-20 Thread Christophe
Mike Meyer a écrit : > Terry Hancock <[EMAIL PROTECTED]> writes: > >>On Tue, 20 Dec 2005 05:35:48 - >>Grant Edwards <[EMAIL PROTECTED]> wrote: >> >>>On 2005-12-20, [EMAIL PROTECTED] <[EMAIL PROTECTED]> >>>wrote: >>> I have csh script that calls a bunch of python programs and I'd like t

Re: OOP: method overriding works in mysterious ways?

2006-01-03 Thread Christophe
John M. Gabriele a écrit : > Consider the following: > > #!/usr/bin/python > > #- > class Grand_parent( object ): > > def speak( self ): > print 'Grand_parent.speak()' > self.advise() > > def advise( self ):

Re: Coding style

2006-07-19 Thread Christophe
Patrick Maupin a écrit : > The perverse wish, expressed in the specific example, that SOME piece > of code SOMEWHERE should PLEASE throw an exception because some idiot > passed a generator expression rather than a list into a function, is > not apt to be well received by an audience which strives

Re: #!/usr/bin/python or #!/usr/bin/env python?

2006-08-09 Thread Christophe
Stephan Kuhagen a écrit : >> Always prefer to use env over a hardcoded path, because that hardcoded >> path will invariably be wrong. (Yes, for those about to nitpick, it's >> conceivable that env might be somewhere other than /usr/bin. However, >> that is very rare and results in a no-win situat

Re: Python and STL efficiency

2006-08-21 Thread Christophe
Jeremy Sanders a écrit : > Licheng Fang wrote: > >> I was using VC++.net and IDLE, respectively. I had expected C++ to be >> way faster. However, while the python code gave the result almost >> instantly, the C++ code took several seconds to run! Can somebody >> explain this to me? Or is there som

Re: Dive Into Java?

2006-10-10 Thread Christophe
Diez B. Roggisch a écrit : > The code _generated_ by the java compiler, and the C++ compiler, is not the > issue here. If you as a programmer can write "a" + "b", its fine. Which is > a thing to reach in C++, a bazillion of string-classes have been > written > > > and in C++, you can do: > >

Re: Dive Into Java?

2006-10-10 Thread Christophe
Diez B. Roggisch a écrit : > Christophe wrote: > >> Diez B. Roggisch a écrit : >>> The code _generated_ by the java compiler, and the C++ compiler, is not >>> the issue here. If you as a programmer can write "a" + "b", its fine. >>> Whic

Re: Tertiary Operation

2006-10-17 Thread Christophe
abcd a écrit : > x = None > result = (x is None and "" or str(x)) > > print result, type(result) > > --- > OUTPUT > --- > None > > > y = 5 > result = (y is 5 and "it's five" or "it's not five") > > print result > > - > OUTPUT > - > it's five >

Re: Python Web Site?

2006-10-18 Thread Christophe
*% a écrit : > Is there a problem with the Python and wxPython web sites? I cannot > seem to get them up, and I am trying to find some documentation... > > Thanks, > Mike All the sites hosted on sourceforge that rely on their vhost computer ( ie, site hosted on sourceforge that do n

Re: Tkinter--does anyone use it for sophisticated GUI development?

2006-10-20 Thread Christophe
Kevin Walzer a écrit : > Am I better off biting the bullet and learning wxPython--a different GUI > paradigm to go with the new language I'm trying to learn? I had hoped to > reduce my learning curve, but I'm very concerned that I simply can't do > what I want to do with Tkinter. What do other Tkin

Re: FOR statement

2006-10-20 Thread Christophe
Lad a écrit : > If I have a list > > Mylist=[1,2,3,4,5] > I can print it > > for i in Mylist: >print i > > and results is > 1 > 2 > 3 > 4 > 5 > > > But how can I print it in a reverse order so that I get > 5 > 4 > 3 > 2 > 1 > > > > ? > > > Thanks. > L > for i in reversed(Mylist):

Re: python GUIs comparison (want)

2006-10-24 Thread Christophe
Kevin Walzer a écrit : > [EMAIL PROTECTED] wrote: >> Now i began to learn GUI programming. There are so many >> choices of GUI in the python world, wxPython, pyGTK, PyQT, >> Tkinter, .etc, it's difficult for a novice to decide, however. >> Can you draw a comparison among them on easy coding, python

Re: python GUIs comparison (want)

2006-10-24 Thread Christophe
Kevin Walzer a écrit : > Christophe wrote: > >> Since when is "based on C++ toolkit" a con? >> > > If you don't know C++ (as is the case with me), then it's difficult to > do a C++-to-Python translation in looking at code examples. As if a toolk

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > David Boddie wrote: > >>> commercial deployment is expensive; free deployment must be GPL; >> >> Opinions differ on the first one of these. > > even if you define "expensive" as "costs more money than the others" ? Even if you consider that the huge time saving you get o

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >> Also, the Tkinter API is far less elegant than the others. > > huh? create object, display object, create object, display object. sure > looks like plain old Python to me... Let's see : .pack(side = "left")

Re: python GUIs comparison (want)

2006-10-25 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >>>> Also, the Tkinter API is far less elegant than the others. >>> huh? create object, display object, create object, display object. >>> sure looks like plain old Python to me... >> >> Let's s

Re: Assertion failure on hotshot.stats.load()

2006-10-27 Thread Christophe
Yang a écrit : > Note: I realize hotshot is obsoleted by cProfile, but 2.5 breaks > several packages I depend on. I'm using Python 2.4.3. > > I'm getting an AssertionError on "assert not self._stack" when calling > hotshot.stats.load() on my app's hotshot profile. The app consistently > causes hot

Re: other ways to check for ?

2006-11-02 Thread Christophe
Sybren Stuvel a écrit : > elderic enlightened us with: >> are there other ways than the ones below to check for > 'function'> in a python script? > > First of all, why would you want to? If you want to call the object > as a function, just do so. Handle the exception that is raised when > it's rai

Re: other ways to check for ?

2006-11-02 Thread Christophe
Sybren Stuvel a écrit : > Christophe enlightened us with: >> I don't think it's a good idea because when you place a try catch >> block around a function call, you'll catch any exception thrown by >> the function itself and not only the "cannot be ca

Re: other ways to check for ?

2006-11-02 Thread Christophe
Christophe a écrit : > Sybren Stuvel a écrit : >> Christophe enlightened us with: >>> I don't think it's a good idea because when you place a try catch >>> block around a function call, you'll catch any exception thrown by >>> the function i

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Christophe
Nick Craig-Wood a écrit : > There is also PyQT which we wrote off as we wanted to write commercial > applications too. As it happens we have a commercial QT licence, but > we decided we didn't want to have to incurr the additional expense of > renewing it. Note: Nothing in the GPL prevents you fro

Re: Sorted list - how to change it

2006-11-09 Thread Christophe
Lad a écrit : > I have a sorted list for example [1,2,3,4,5] and I would like to change > it in a random way > e.g [2,5,3,1,4] or [3,4,1,5,2] or in any other way except being > ordered. > What is the best/easiest > way how to do it? > > Thank you for help > L. Not accepting that the shuffle outp

Re: How to choose the right GUI toolkit ?

2006-11-09 Thread Christophe
Dan Lenski a écrit : > Nick and John S., thank you for the tip on wxPython! I'll look into it > for my next project. I too would avoid Qt, not because of the GPL but > simply because I don't use KDE under Linux and because Qt is not well > supported under Cygwin or on native Windows. Qt is very w

Re: explicit self revisited

2006-11-13 Thread Christophe
Simon Brunning a écrit : > On 11/13/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >> >> > I suppose that in his view, language advocacy is a zero-sum game, so >> > positive comments about Python can be considered as FUD against his own >> > project. He's even invented his own del.icio.us tag for th

Re: Py3K idea: why not drop the colon?

2006-11-15 Thread Christophe
Stephen Eilert a écrit : > Well, I *hate* underscores with a passion. So it is kinda frustrating > that I *have* to say "__init__". The fact that the coding conventions > for Python suggest things such as methods_called_this_or_that do not > help. Everything else seems fine, since if there's voodoo

Re: Function mistaken for a method

2006-06-01 Thread Christophe
Eric Brunel a écrit : > On Thu, 01 Jun 2006 13:34:53 +0200, Peter Otten <[EMAIL PROTECTED]> wrote: > >> Eric Brunel wrote: >> >>> My actual question is: why does it work in one case and not in the >>> other? >>> As I see it, int is just a function with one parameter, and the >>> lambda is >>>

Re: Function mistaken for a method

2006-06-02 Thread Christophe
Maric Michaud a écrit : > Le Jeudi 01 Juin 2006 15:36, Christophe a écrit : > >> self.x = self.__class__.f(0) > > nope, this will result in a TypeError "unbound method must be called with > instance as first argument" Your right :( staticmethod it is t

Re: Writing to a certain line?

2006-06-07 Thread Christophe
bruno at modulix a écrit : > Tommy B wrote: > >>bruno at modulix wrote: > > > (snip) > > >>>import os >>>old = open("/path/to/file.txt", "r") >>>new = open("/path/to/new.txt", "w") >>>for line in old: >>> if line.strip() == "Bob 62" >>> line = line.replace("62", "66") >>> new.write(line) >>>

Re: Numerics, NaNs, IEEE 754 and C99

2006-06-14 Thread Christophe
Grant Edwards a écrit : > The division by zero trap is really annoying. In my world the > right thing to do is to return Inf. Your world is flawed then, this is a big mistake. NaN is the only aceptable return value for a division by zero. -- http://mail.python.org/mailman/listinfo/python-list

Re: Numerics, NaNs, IEEE 754 and C99

2006-06-14 Thread Christophe
Grant Edwards a écrit : > On 2006-06-14, Christophe <[EMAIL PROTECTED]> wrote: > >>Grant Edwards a écrit : >> >>>The division by zero trap is really annoying. In my world the >>>right thing to do is to return Inf. >> >>Your world is flawed th

Re: Numerics, NaNs, IEEE 754 and C99

2006-06-15 Thread Christophe
Nick Maclaren a écrit : > Now, can you explain why 1/0 => -Inf wouldn't work as well? I.e. why > are ALL of your zeroes, INCLUDING those that arise from subtractions, > are known to be positive? I would say that the most common reason people assume 1/0 = Inf is probably because they do not make

Re: __lt__ slowing the "in" operator even if not called

2006-06-15 Thread Christophe
Emanuele Aina a écrit : > Maric Michaud continuò: > > >>>But I hoped in a more exaustive answer: why python has to do this >>>lookup when the __lt__ method is not involved at all? >> >>It is not the case, that's what my program shows : >> >> >> >>in operator at the beginning of list: 173 >>in ope

Re: Psyco performance

2006-06-20 Thread Christophe
[EMAIL PROTECTED] wrote: > I'm not seeing much benefit from psyco (only 5-10% faster). Maybe this > example is too trivial? Can someone give me some pointers as to what > kind of code would see a dramatic benefit? > > Here's the code: > > import time > import psyco > > n = 10 > > t1 = time.

Re: Pros/Cons of Turbogears/Rails?

2006-08-29 Thread Christophe
Paul Boddie a écrit : > [comp.lang.ruby snipped] > > Ray wrote: >> I've met a number of >> people who've told me they'd program in Eiffel if they could. And hey, >> perhaps in its day Eiffel *was* the best OO language out there. >> Certainly it looked cleaner than C++! :) > > So why don't they? M

Re: Pros/Cons of Turbogears/Rails?

2006-08-31 Thread Christophe
Jaroslaw Zabiello a écrit : > Python is maybe faster, but with YARM (which is not stable yet) Ruby > will be about 10x faster. YARM is full virtual machine like Java. Google doesn't find YARM and so, YARM does not exist. Care to provide an URL or something? -- http://mail.python.org/mailman/list

Re: When is it a pointer (aka reference) - when is it a copy?

2006-09-14 Thread Christophe
John Henry a écrit : > Hi list, > > Just to make sure I understand this. > > Since there is no "pointer" type in Python, I like to know how I do > that. > > For instance, if I do: > >...some_huge_list is a huge list... >some_huge_list[0]=1 >aref = some_huge_list >aref[0]=0 >

Re: UDP packets to PC behind NAT

2006-09-15 Thread Christophe
Janto Dreijer a écrit : > This is probably more of a networking question than a Python one, but > it would be nice to know if someone has done this with Python's socket > module. And besides one usually gets more information from c.l.py than > anywhere else :) > > I have a server with a static "pu

Re: add without carry

2006-09-15 Thread Christophe
Bruno Desthuilliers a écrit : > Bryan Olson wrote: >> Hugh wrote: >>> Sorry, here's an example... >>> >>> 5+7=12 >>> >>> added without carrying, 5+7=2 >>> >>> i.e the result is always less than 10 >> Are you looking for bitwise exclusive or? In Python it's >> the '^' operator. For example: >> >>

Re: Evaluation of Truth Curiosity

2006-09-21 Thread Christophe
James Stroud a écrit : > Hello All, > > I'm curious, in > > py> 0 | (1 == 1) > 1 > py> False | (1 == 1) > True > > What is the logic of the former expression not evaluating to True (or > why the latter not 1?)? Is there some logic that necessitates the first > operand's dictating the result of

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Christophe
Brendan a écrit : > Hello, > I just tried to use the Windows XP installer for Python 2.5 AMD64 but I > get the error message: "Installation package not supported by processor > type" > > I am running Windows XP Pro on an AMD Athon 64 Processor. > > Do I need to have a 64-bit OS to use this versio

Re: Python 2.5 WinXP AMD64

2006-09-21 Thread Christophe
Bjoern Schliessmann a écrit : > Christophe wrote: > >> To be exact, you need a 64bit Windows OS on a 64bit cpu. > > Is there a reason that can be explained in a less-than-2-KB > posting? :) I mean why Python depends on the processor type that > much. > > Regar

Re: Verify an e-mail-adress - syntax and dns

2006-09-25 Thread Christophe
Steven D'Aprano a écrit : > By memory, in an thread about the same topic just a few days ago, Fredrik > Lundh posted a link to Perl's FAQs that suggests a method for "validating" > email addresses: treat it like a password and ask the user to type it > twice. That will protect against simple typos

Re: Verify an e-mail-adress - syntax and dns

2006-09-25 Thread Christophe
Georg Brandl a écrit : > Christophe wrote: >> Steven D'Aprano a écrit : >>> By memory, in an thread about the same topic just a few days ago, >>> Fredrik >>> Lundh posted a link to Perl's FAQs that suggests a method for >>> "validatin

Re: Verify an e-mail-adress - syntax and dns

2006-09-25 Thread Christophe
Steve Holden a écrit : > Christophe wrote: >> Steven D'Aprano a écrit : >> >>> By memory, in an thread about the same topic just a few days ago, >>> Fredrik >>> Lundh posted a link to Perl's FAQs that suggests a method for >>> "

Re: Verify an e-mail-adress - syntax and dns

2006-09-26 Thread Christophe
Steven D'Aprano a écrit : > On Mon, 25 Sep 2006 16:11:38 +0200, Christophe wrote: >> This is useless AND annoying at the same time. > > But people like us don't screw up our email address in the first place, > and if we do, we know how to fix it. Not everybody is l

Re: Surprise using the 'is' operator

2006-09-26 Thread Christophe
codefire a écrit : > I thought the 'is' operator was used to identify identical objects, > whereas the '==' operator checked equality. Well, I got a surprise > here: > > IDLE 1.1.3 a = 10 b = a a is b > True a == b > True c = 10 a == c > True a is c > True > > I

Re: A critique of cgi.escape

2006-09-26 Thread Christophe
Sion Arrowsmith a écrit : > Jon Ribbens <[EMAIL PROTECTED]> wrote: >> In article <[EMAIL PROTECTED]>, Duncan Booth wrote: >>> I guess you've never seen anyone write tests which retrieve some generated >>> html and compare it against the expected value. If the page contains any >>> unescaped quot

Re: Surprise using the 'is' operator

2006-09-26 Thread Christophe
codefire a écrit : > Haha! > > OK thanks guys. > > I was just trying to check if objects were the same (object), didn't > know Integers were a special case. They are not a special case so much. It's just that "is" is extremly unreliable unless you're the one who created the objects. In the case

Re: Sockets in python

2006-10-03 Thread Christophe
OneMustFall a écrit : > >> What's your set-up and which cord are you pulling? >> > > Well i now i think the clue is in the OS, i have sniffed and it seems > that Twisted have no magic. > It is seems that i simply tested things in a wrong way - > when i pulled cord from ethernet card windows deter

Re: python Noob - basic setup question / problem

2006-12-04 Thread Christophe
Lilavivat a écrit : > Running SUSE 10.1 on an AMD64. When I try and run a python program I get > the following error: > > /usr/bin/python2: bad interpreter: No such file or directory > > "which python" gives me "/usr/local/bin/python" > > "which python2.4" gives me "/usr/local

Re: Am I stupid or is 'assert' broken in Python 2.5??

2006-12-06 Thread Christophe
antred a écrit : > I've noticed something odd in Python 2.5, namely that the 2 argument > version of 'assert' is broken. Or at least it seems that way to me. > > Run the following code in your Python interpreter: > > myString = None > > assert( myString, 'The string is either empty or set to th

Re: merits of Lisp vs Python

2006-12-11 Thread Christophe
André Thieme a écrit : > You don't even need to say 'function > (memoize function) would be enough. > And yes, you can memoize functions while the program is running. > And you don't need a tool like slime for it. Lisp already offers ways > for doing that. In Python while the program is runnin

Re: merits of Lisp vs Python

2006-12-12 Thread Christophe
André Thieme a écrit : > Paul Rubin schrieb: >> André Thieme <[EMAIL PROTECTED]> writes: import module module.function = memoize(module.function) >>> Yes, I mentioned that a bit earlier in this thread (not about the >>> "during runtime" thing). >>> I also said that many macros only save s

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
Robert Uhl a écrit : > [EMAIL PROTECTED] (Aahz) writes: >> Consider this: Lisp has had years of development, it has had millions of >> dollars thrown at it by VC firms -- and yet Python is winning over Lisp >> programmers. Think about it. > > The argument from popularity is invalid. French units

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
[EMAIL PROTECTED] a écrit : > Bjoern Schliessmann wrote: >> Robert Uhl wrote: >> >>> Because it's the language for which indentation is automatically >>> determinable. That is, one can copy/paste a chunk of code, hit a >>> key and suddenly everything is nicely indented. >> Cool, so in other langua

Re: merits of Lisp vs Python

2006-12-13 Thread Christophe
Pascal Bourguignon a écrit : > Christophe <[EMAIL PROTECTED]> writes: > >> Robert Uhl a écrit : >>> [EMAIL PROTECTED] (Aahz) writes: >>>> Consider this: Lisp has had years of development, it has had millions of >>>> dollars thrown at it

Re: merits of Lisp vs Python

2006-12-14 Thread Christophe
Robert Uhl a écrit : > Christophe <[EMAIL PROTECTED]> writes: >> Saying that the French units are technically worse than standard units >> is a troll of very poor quality and a very weak argument. > > It was just an example that the argument from popularity is inva

Re: speed of python vs matlab.

2006-12-14 Thread Christophe
Chao a écrit : > My Bad, the time used by python is 0.46~0.49 sec, > I tried xrange, but it doesn't make things better. > > import time > tic = time.time() > a = 1.0 > > array = range(1000) > > for i in array: > for j in array: > a = a + 0.1 > > toc = time.time() > print toc-tic,' ha

  1   2   >