[asyncio] Suggestion for a major PEP

2018-12-16 Thread Christophe Bailly
Hello, I copy paste the main idea from an article I have written: contextual async " Imagine you have some code written for monothread. And you want to include your code in a multithread environment. Do you need to adapt all your c

Re: deque and thread-safety

2012-10-12 Thread Christophe Vandeplas
Ok sorry for the mail, I found the solution by using deque.count(url) that's available starting from python 2.7 On Fri, Oct 12, 2012 at 2:40 PM, Christophe Vandeplas wrote: > Hello, > > I have a question about deque and thread-safety. > > My application has multiple threads

deque and thread-safety

2012-10-12 Thread Christophe Vandeplas
oes what I need Thanks for your expertise. Christophe -- http://mail.python.org/mailman/listinfo/python-list

Re: Floating point multiplication in python

2011-09-07 Thread Christophe Chong
04925e-16 2.22044604925e-16 > 1.1 0.0 1.11022302463e-16 2.22044604925e-16 > 1.1 0.0 0.0 0.0 > 1.1 0.0 0.0 0.0 > 1.1 0.0 1.38777878078e-17 0.0 > 1.1 0.0 6.93889390391e-18 0.0 > > So here we have reached the point where the maximum precision is reached - > a doesn't change anymo

Re: Ten rules to becoming a Python community member.

2011-08-14 Thread Christophe Chong
I can't tell which comments are sarcastic On Aug 14, 2011, at 18:35, rantingrick wrote: > On Aug 14, 5:01 pm, Dave Angel wrote: > >> Interesting that when you complain about other's grammatical typos, >> you're so careless with your own. >> >> know -> now >> i -> I >> accustom -> accustomed >

Re: how to find out the version of a certain installed package

2008-09-30 Thread Christophe
great! thanks for you fast response. Christophe On Tue, Sep 30, 2008 at 6:30 PM, M.-A. Lemburg <[EMAIL PROTECTED]> wrote: > On 2008-09-30 18:17, Christophe wrote: > > Hi, > > > > In a projecet I'm making using pycrypto, I need to find out the > > curren

how to find out the version of a certain installed package

2008-09-30 Thread Christophe
are there other ways? thanks, Christophe -- http://mail.python.org/mailman/listinfo/python-list

PyCon FR - Journées Python

2008-03-23 Thread Christophe Combelles
PyCon FR will take place in Paris, France, 17-18 May 2008. The French Python Association (AFPY) is organizing this event called "Journées Python" for the second time. We expect most talks to be in french, but any proposal in english is also greatly welcome! You may submit your idea of talks and p

PyCon FR - Journées Python

2008-03-23 Thread Christophe Combelles
PyCon FR will take place in Paris, France, 17-18 May 2008. The French Python Association (AFPY) is organizing this event called "Journées Python" for the second time. We expect most talks to be in french, but any proposal in english is also greatly welcome! You may submit your idea of talks and p

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-31 Thread Christophe
Joe Riopel a écrit : >> Each requires exactly the same number of key strokes when I do the >> math. (Too lazy to explain further...) > > foo_bar > f, o, o, shift + underscore, b, a, r = 8 > fooBar > f, o, o, shift + b, a, r = 7 f, o, o, _, b, a, r = 7 f, o, o, shift + b, a, r = 8 Also the shift+

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-20 Thread Christophe Cavalaria
Istvan Albert wrote: > On May 19, 3:33 am, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >> >That would be invalid syntax since the third line is an assignment >> > with target identifiers separated only by spaces. >> >> Plus, the identifier starts with a number (even though 6 is not DIGIT >

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Christophe
René Fleschenberg a écrit : > Christophe schrieb: >> You should know that displaying and editing UTF-8 text as if it was >> latin-1 works very very well.s > > No, this only works for those characters that are in the ASCII range. > For all the other characters it does not

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Christophe
[EMAIL PROTECTED] a écrit : > Christophe wrote: >> [EMAIL PROTECTED] a ecrit : >>> Steven D'Aprano wrote: >>>> I would find it useful to be able to use non-ASCII characters for heavily >>>> mathematical programs. There would be a closer correspond

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-16 Thread Christophe
[EMAIL PROTECTED] a écrit : > Steven D'Aprano wrote: >> I would find it useful to be able to use non-ASCII characters for heavily >> mathematical programs. There would be a closer correspondence between the >> code and the mathematical equations if one could write D(u*p) instead of >> delta(mu*pi).

Re: PEP 3131: Supporting Non-ASCII Identifiers

2007-05-15 Thread Christophe
Stefan Behnel a écrit : > George Sakkis wrote: >> After 175 replies (and counting), the only thing that is clear is the >> controversy around this PEP. Most people are very strong for or >> against it, with little middle ground in between. I'm not saying that >> every change must meet 100% acceptan

Re: Do other Python GUI toolkits require this?

2007-04-20 Thread Christophe
Nigel Rowe a écrit : > On Thu, 19 Apr 2007 19:11, Antoon Pardon wrote in comp.lang.python: >> On 2007-04-19, Michael Bentley <[EMAIL PROTECTED]> wrote: > > > >>> The learning curve is rather steep IMO, but worth it. >> Just a throw in remark, that you may ignore if you wish, but a steep >> lear

Re: pop() clarification

2007-04-12 Thread Christophe
Carl Banks a écrit : > On Apr 11, 3:10 pm, "7stud" <[EMAIL PROTECTED]> wrote: >> On Apr 11, 10:44 am, "Scott" <[EMAIL PROTECTED]> wrote: >> >> >> >>> As said before I'm new to programming, and I need in depth explaination to >>> understand everything the way I want to know it, call it a personality

Re: Why NOT only one class per file?

2007-04-05 Thread Christophe
Chris Lasher a écrit : > A friend of mine with a programming background in Java and Perl places > each class in its own separate file in . I informed him that keeping > all related classes together in a single file is more in the Python > idiom than one file per class. He asked why, and frankly, hi

Re: python QT or python-GTK

2007-03-20 Thread Christophe
Dennis Lee Bieber a écrit : > Not enough experience here... I do know I never liked applications > targeted to the "Gnome" look, preferring KDE... So... which toolkit did > those desktops favor? > > wxWidgets, as I recall, is supposed to attempt to look "native" on > each OS. Well, wx

Re: Pep 3105: the end of print?

2007-02-27 Thread Christophe
Martin v. Löwis a écrit : > Neil Cerutti schrieb: >> On 2007-02-23, I V <[EMAIL PROTECTED]> wrote: >>> While that's true, C++ compiler vendors, for example, take >>> backwards compatibility significantly less seriously, it seems >>> to me. >> Compiler vendors usually take care of their customers w

Re: How to ping and shutdown a remote computer?

2007-02-14 Thread Christophe
[EMAIL PROTECTED] a écrit : > I am working on a Python script to perform as a remote computer > manager. So far I have a WOL function working and I would like to add > the ability to show if a machine is on or off (I figured I would do so > by pinging the machine and seeing if I get a response). I

Re: Help me understand this

2007-01-31 Thread Christophe
James Stroud a écrit : > Beej wrote: > (2).__add__(1) > > Nice. I would have never thought to put parentheses around an integer to > get at its attributes. > > James You can also do it like that : >>> 2 .__add__(1) 3 -- http://mail.python.org/mailman/listinfo/python-list

Re: Sorting on multiple values, some ascending, some descending

2007-01-04 Thread Christophe
[EMAIL PROTECTED] a écrit : > Raymond Hettinger: >> The simplest way is to take advantage of sort-stability and do >> successive sorts. For example, to sort by a primary key ascending and >> a secondary key decending: >>L.sort(key=lambda r: r.secondary, reverse=True) >>L.sort(key=lambda r:

Re: python , Boost and straight (but complex) C code

2006-12-30 Thread Christophe Cavalaria
Osiris wrote: > On Sat, 30 Dec 2006 13:19:28 -0800, Erik Max Francis <[EMAIL PROTECTED]> > wrote: > >>Osiris wrote: >> >>> I have these pieces of C-code (NOT C++ !!) I want to call from Python. >>> I found Boost. >>> I have MS Visual Studio 2005 with C++. >>> >>> is this the idea: >>> I write th

Re: Can I beat perl at grep-like processing speed?

2006-12-29 Thread Christophe Cavalaria
js wrote: > Just my curiosity. > Can python beats perl at speed of grep-like processing? > > > $ wget http://www.gutenberg.org/files/7999/7999-h.zip > $ unzip 7999-h.zip > $ cd 7999-h > $ cat *.htm > bigfile > $ du -h bigfile > du -h bigfile > 8.2M bigfile > > -- grep.pl -- >

Re: DOS, UNIX and tabs

2006-12-28 Thread Christophe Cavalaria
Felix Benner wrote: > Christophe Cavalaria schrieb: >> Steven D'Aprano wrote: > >> You gave the reason in your post : because other people who are using >> software that doesn't understand tabs as YOU expect them to have problems >> with your code. >&g

Re: DOS, UNIX and tabs

2006-12-28 Thread Christophe Cavalaria
Steven D'Aprano wrote: > On Thu, 28 Dec 2006 09:26:28 +0100, Sebastian 'lunar' Wiesner wrote: > >> It is, and especially the problems with tabs shows you, why it is good >> practice to follow the standard in your own code, too... > > I don't know what "problems" with tabs you are talking about.

Re: Good Looking UI for a stand alone application

2006-12-17 Thread Christophe Cavalaria
Vincent Delporte wrote: > On Sun, 17 Dec 2006 09:37:04 +0100, [EMAIL PROTECTED] (Luc Heinrich) > wrote: >>Crossplatform toolkits/frameworks suck. All of them. No exception. If >>you want your app to look *AND* feel great on all platform, abstract the >>core of your application and embed it in plat

Re: Good Looking UI for a stand alone application

2006-12-17 Thread Christophe Cavalaria
Sandra-24 wrote: > On 12/16/06, The Night Blogger <[EMAIL PROTECTED]> wrote: >> Can someone recommend me a good API for writing a sexy looking (Rich UI >> like WinForms) shrink wrap application > >> My requirement is that the application needs to look as good on Windows >> as on the Apple Mac >

Re: merits of Lisp vs Python

2006-12-16 Thread Christophe Cavalaria
Paul Rubin wrote: > Kirk Sluder <[EMAIL PROTECTED]> writes: >> Personally, I've always preferred use the imperative to describe >> basic math rather than the passive. This would seem to map better to >> RPN than infix. > > For writing down complicated, nested expressions too? That's very > unus

Re: merits of Lisp vs Python

2006-12-15 Thread Christophe Cavalaria
Paul Rubin wrote: > André Thieme <[EMAIL PROTECTED]> writes: >> def nif(num, pos, zero, neg): >>if num > 0: >> return pos >>else: >> if num == 0: >>return zero >> else: >>return neg > > def nif(num, pos, zero, neg): >return (neg, zero, pos)[cmp(num, 0)+1

Re: merits of Lisp vs Python

2006-12-14 Thread Christophe
Robert Uhl a écrit : > Ken Tilton <[EMAIL PROTECTED]> writes: >> meanwhile, I have not seen how Python lets you avoid revisiting dozens >> of instances when changes to a mechanism are required. > > I think his solution would have been to use: > > def foo(**args): > > everywhere, and call it li

Re: merits of Lisp vs Python

2006-12-14 Thread Christophe
[EMAIL PROTECTED] a écrit : > Christophe wrote: >> Call us when you have an editor that reads your mind and writes the () >> for you. > > This is an irrelevancy. Typos that drop printing characters in either > language will generally cause changes to the seman

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

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: 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-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
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-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-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: 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: 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: 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: 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: 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: 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
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: 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: 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
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: 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: 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: 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 : > 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-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-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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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: 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-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
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: 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: 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: 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: 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: 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: 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: 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: 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: 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: #!/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: 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: 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: __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: 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: 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-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: 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: 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: 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: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-20 Thread Christophe Cavalaria
Christopher Weimann wrote: > On 05/19/2006-07:18AM, Duncan Booth wrote: >> >> My experience of programming with either spaces or tabs has taught me >> that tabs are evil not for themselves, but simply because no matter how >> hard you try they always end up being mixed with spaces. >> > > Swap

Re: open file with whitespaces

2006-05-19 Thread Christophe
mardif a écrit : > Hi guys. > I've a very big big big problem: > > I've in my windows computer a file named cicciobello.html, located in > c:\documents and settings\username\desktop\cicciobello.html. > > Now, I MUST open this file with os.spawn(os.P_WAIT , because I must > wait the user cance

Re: Question about exausted iterators

2006-05-19 Thread Christophe
Terry Reedy a écrit : > "Christophe" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > >>Instead of saying that all works as intended could you be a little >>helpful and tell me why it was intended in such an obviously broken way >>inst

Re: Complex evaluation bug

2006-05-19 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >>> So, putting them together, you could expect >>>eval(repr(a)) >>> to reproduce a, and in fact it does so. >> >> >> Says who ? >> >> Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC

Re: Tabs are *MISUNDERSTOOD*, *EVIL* AND *STUPID*, end of discussion. (Re: Tabs versus Spaces in Source Code)

2006-05-19 Thread Christophe
PoD a écrit : > Maybe what Python should do (but never will given the obsession with using > spaces) is only allow one level of indentation increase per block so that > > def foo(): > return 'bar' > > would return a syntax error Which would make mandatory for indentation. What about some freed

Re: Complex evaluation bug

2006-05-19 Thread Christophe
Gary Herron a écrit : > of wrote: > >> a = 1+3j >> complex(str(a)) >> >> Why does this not work ? It should >> >> > Says who? > By normal conventions in Python, "str" attempts only to make a "nice" > human readable representation. The function "repr" is usually expected > to provide output th

Re: Question about exausted iterators

2006-05-18 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >> Maybe I've used more iterables than most of you. Maybe I've been doing >> that wrong. > > > your problem is that you're confusing iterables with sequences. they're > two different things. Yes,

Re: Question about exausted iterators

2006-05-18 Thread Christophe
Roel Schroeven a écrit : > Fredrik Lundh schreef: >> so what is a valid answer? > > > I think he wants to know why the spec has been written that way. > > The rationale mentions exhausted iterators: > > "Once a particular iterator object has raised StopIteration, will > it also raise StopIterat

Re: Question about exausted iterators

2006-05-18 Thread Christophe
Diez B. Roggisch a écrit : > Christophe wrote: > > >>Fredrik Lundh a écrit : >> >>>Christophe wrote: >>> >>> >>>>Because I'm still waiting for a valid answer to my question. The >>>>answer "Because it has been co

Re: Question about exausted iterators

2006-05-18 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >>>> Because I'm still waiting for a valid answer to my question. The >>>> answer "Because it has been coded like that" or is not a valid one. >>> >>> >>> it's been

Re: Question about exausted iterators

2006-05-18 Thread Christophe
Fredrik Lundh a écrit : > Christophe wrote: > >> Because I'm still waiting for a valid answer to my question. The >> answer "Because it has been coded like that" or is not a valid one. > > > it's been coded like that because that's what th

  1   2   >