Re: why memoizing is faster

2011-03-26 Thread Lie
On Mar 26, 5:10 pm, Terry Reedy wrote: > On 3/26/2011 12:17 AM, Stefan Behnel wrote: > > > Not "restarted" in the sense that it gets cleaned up, though. The above > > simply passes an explicit value for it that will be used for the single > > call. > > Which satisfies the time test need, but... >

About Rational Number (PEP 239/PEP 240)

2007-12-15 Thread Lie
I'm very surprised actually, to see that Python rejected the use of fractional/rational numbers. However, when I read the PEP, I know exactly why the proposal was rejected: People compared fractions with integers, while it should be more fairly compared to floats. Arguments against: - When I use t

Re: About Rational Number (PEP 239/PEP 240)

2007-12-15 Thread Lie
The easiest implementation of using fractional datatype is probably to add a new operator. Some scientific calculators provide a special operator to signify a fraction (somewhat on the shape of a small L in mine) and I strongly believe that their internal calculation probably used fractions even w

Re: About Rational Number (PEP 239/PEP 240)

2007-12-15 Thread Lie
On Dec 16, 4:55 am, "Fredrik Johansson" <[EMAIL PROTECTED]> wrote: > On Dec 15, 2007 10:05 PM, Lie <[EMAIL PROTECTED]> wrote: > > > Random ramble past here: > > Actually, my vision would be not only fractions, but also rooted > > number (square

Re: About Rational Number (PEP 239/PEP 240)

2007-12-16 Thread Lie
> Rationals are not that simple. So do complex number, in fact most people are much more familiar with rationals/fractions than with complex number. And notice that I don't use the word simple, I use the word elementary. Elementary doesn't always means simple (although it usually is), but rather i

Odd behavior in Python/Tkinter?

2007-12-21 Thread Lie
Inspect the following code: --- start of code --- import Tkinter as Tk from Tkconstants import * root = Tk.Tk() e1 = Tk.Entry(root, text = 'Hello World') e2 = Tk.Entry(root, text = 'Hello World') e1.grid(row = 1, column = 1) e2.grid(row = 2, column = 1) e1.insert(END, 'Hello Python') root.mai

Re: How to handle multi-line quotes

2007-12-21 Thread Lie
On Dec 22, 2:15 am, [EMAIL PROTECTED] wrote: > Thinking about unclosed multi-line quotes. > > When you open a multi-line quote (type '"""') what does your editor > do? Does it color the remainder of your text as a quote, or does it > color the line with the open quote as a quote and leave the rest

Re: exception message output problem

2007-12-21 Thread Lie
On Dec 22, 2:57 am, "Russ P." <[EMAIL PROTECTED]> wrote: > I am baffled about why my exception messages are not displaying > properly. > > I have a class that represents physical scalars with units. If I type > > >>> 3 * s + 4 * m > > I should get something like this: > > scalar.InconsistentUnits:

Re: Odd behavior in Python/Tkinter?

2007-12-21 Thread Lie
On Dec 22, 4:05 am, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > > Inspect the following code: > > > --- start of code --- > > import Tkinter as Tk > > from Tkconstants import * > > > root = Tk.Tk() > > > e1 = Tk.Entry(root, text

Re: Odd behavior in Python/Tkinter?

2007-12-22 Thread Lie
On Dec 22, 1:42 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > >>> Inspect the following code: > > >>> --- start of code --- > >>> import Tkinter as Tk > >>> from Tkconstants import * > >>> root = Tk.Tk() > &

Re: exception message output problem

2007-12-22 Thread Lie
On Dec 22, 6:18 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Lie a écrit : > (snip) > > > # Python have an odd (read: broken) singleton implementation > > # single member tuple must have a comma behind it > > You may call it weird or even a wart if you want

Re: exception message output problem

2007-12-22 Thread Lie
PPS: Actually, what makes a tuple is both the parens and the comma, with comma as the minimum signifier, inspect this: "str(a) + str((a,b,c))", you have to use the double parens, one to make the tuple and the other as part of the str. This harmless little case gives error if done without the double

Re: Odd behavior in Python/Tkinter?

2007-12-22 Thread Lie
> But an expression (e.g. string) is NOT a variable. It's fine if the > value mirrored when I set the textvariable conf to the same variable, > but in this case I'm setting them to the same expression (e.g. string). On the other hand, the oddness multiplied since the value replication doesn't happ

Re: Odd behavior in Python/Tkinter?

2007-12-22 Thread Lie
On Dec 22, 7:35 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > > But an expression (e.g. string) is NOT a variable. > > in this case, it is.  I don't know if it's worth spending more time on > this, since you're not listening, but let's make

Re: exception message output problem

2007-12-22 Thread Lie
On Dec 23, 4:30 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Lie a écrit : > > > PPS: Actually, what makes a tuple is both the parens and the comma, > > Nope, it's definively the comma. You can check the language's grammar, > it's part of the do

Re: Python DLL in Windows Folder

2007-12-24 Thread Lie
On Dec 25, 3:04 am, "Markus Gritsch" <[EMAIL PROTECTED]> wrote: > On 24/12/2007, Chris Mellon <[EMAIL PROTECTED]> wrote: > > > > > On Dec 23, 2007 12:27 PM, Markus Gritsch <[EMAIL PROTECTED]> wrote: > > > On 23/12/2007, Christian Heimes <[EMAIL PROTECTED]> wrote: > > > > Markus Gritsch wrote: > > >

Re: Python DLL in Windows Folder

2007-12-26 Thread Lie
On Dec 27, 12:30 am, "Markus Gritsch" <[EMAIL PROTECTED]> wrote: > On 26/12/2007, Lie Ryan <[EMAIL PROTECTED]> wrote: > > > On Dec 25, 2007 4:43 PM, Markus Gritsch <[EMAIL PROTECTED]> wrote: > > > On 24/12/2007, Lie <[EMAIL PROTECTED]> wro

Re: convert pdf to png

2007-12-27 Thread Lie
On Dec 27, 7:33 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > Good point.  Not that I am willing to risk it (just using the pdf is not > > such a bad option)  but I am wondering if it would make sense to create > > a ramdrive for something like this.  if memory is needed, swap would > > hap

Re: cloud computing (and python)?

2008-01-05 Thread Lie
> I mean, really, I've been using web-mail and various varieties of > remote > storage for over a decade.  What is *new* about the concept?  (I see > some > hints above, but it's mixed in with a lot of other stuff...) In essence, you're correct, this concept of cloud computing actually have existe

Re: Basic inheritance question

2008-01-05 Thread Lie
On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > Jeroen Ruigrok van der Werven wrote: > > > Shouldn't this be: > > > self.startLoc = start > > self.stopLoc = stop > > Thanks! Of course it should. Old Java habits die slowly. No, seriously it isn't Java habits only, most other languages wouldn't need e

Re: what does **kw mean?

2008-01-11 Thread Lie
On Jan 11, 4:38 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I've been reading the following example, and couldn't figure out, what > **kw mean. (It's an empty dictionary, but what's the semantics): It's a keyword argument. It's some kind of repository for arguments that aren't recognized.

Property with Arguments

2008-01-11 Thread Lie
Is there a way to create a property with arguments? Or an index value like a list? To be used in the form like: someClass.someProperty['arguments'] = 'some value' or someClass.someProperty('argument1', 'argument2') = 'some value' -- http://mail.python.org/mailman/listinfo/python-list

Re: Property with Arguments

2008-01-11 Thread Lie
On Jan 11, 6:20 pm, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Lie wrote: > > Is there a way to create a property with arguments? > > That's called method in Python, and has it's own syntax.  You cannot > assign to methods. So you've got to use methods

Exceptions - How do you make it work like built-in exceptions?

2008-01-13 Thread Lie
A built-in exceptions, when raised, would print traceback that points out the offending code, like this: Traceback (most recent call last): File "F:\dir\code.py", line 43, in a = 1/0 <<<--- ZeroDivisionError: integer division or modulo by zero a user-made exception, when raised, would prin

Re: Basic inheritance question

2008-01-14 Thread Lie
On Jan 7, 2:46 am, Bruno Desthuilliers <[EMAIL PROTECTED]> wrote: > Lie a écrit : > > > On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > > >>Jeroen Ruigrok van der Werven wrote: > > >>>Shouldn't this be: > > >>>self.startLoc = start >

Re: Exceptions - How do you make it work like built-in exceptions?

2008-01-14 Thread Lie
On Jan 14, 1:51 am, "Mark Tolonen" <[EMAIL PROTECTED]> wrote: > "Lie" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > > >A built-in exceptions, when raised, would print traceback that points > > out the off

Re: How to get user home directory on Windows

2008-01-14 Thread Lie
On Jan 14, 8:21 am, "Martin P. Hellwig" <[EMAIL PROTECTED]> wrote: > Giampaolo Rodola' wrote: > > Hi all, > > I'm trying to use the pywin32 extension to find out the user's home > > directory but currently I didn't find a solution yet. > > What I'd need to do is not getting the home directory of th

Re: __init__ explanation please

2008-01-15 Thread Lie
I've been in this Python mailing list for a few days, and I've noticed several things here: There are too many fundamentalist! Don't play stupid and all, don't be a fundamentalist. It might be true that __init__ isn't a constructor and __new__ might be the constructor (some people even claimed __n

Re: Basic inheritance question

2008-01-16 Thread Lie
On Jan 15, 9:00 pm, Bruno Desthuilliers wrote: > Lie a écrit : > > > > > On Jan 7, 2:46 am, Bruno Desthuilliers > > <[EMAIL PROTECTED]> wrote: > >> Lie a écrit : > > >>> On Jan 5, 5:40 pm, [EMAIL PROTECTED] wrote: > >>&g

Re: __init__ explanation please

2008-01-17 Thread Lie
On Jan 16, 5:34 am, "Reedick, Andrew" <[EMAIL PROTECTED]> wrote: > > >From the base definition of a constructor: constructor is the creator > > of an object. In this case, __new__ is technically the constructor > > while __init__ is an initializer. > > > However, it is also to be noted that __init_

Re: Basic inheritance question

2008-01-20 Thread Lie
On Jan 16, 9:23 pm, Bjoern Schliessmann wrote: > Lie wrote: > > [EMAIL PROTECTED]> wrote: > >> I used to systematically use it - like I've always systematically > >> used 'this' in C++ and Java. > > > And that is what reduces readability.

Re: Basic inheritance question

2008-01-21 Thread Lie
> > Please stop taking my words to its letters. > > So we're supposed to actually guess what you really mean ??? That's what human does, otherwise you'll "Fail the Turing Test". > >> Personally, I've seen many C++ programs with complex class designs > >> where it definitely helps to consistently

Re: Encrypting a short string?

2008-02-16 Thread Lie
On Feb 12, 2:45 am, erikcw <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to devise a scheme to encrypt/obfuscate a short string that > basically contains the user's username and record number from the > database.  I'm using this encrypted string to identify emails from a > user. (the string will

How about adding rational fraction to Python?

2008-02-16 Thread Lie
Would all these problems with floating points be a rational reason to add rational numbers support in Python or Py3k? (pun not intended) I agree, there are some numbers that is rationals can't represent (like pi, phi, e) but these rounding problems also exist in floating points, and rational numbe

Re: How about adding rational fraction to Python?

2008-02-16 Thread Lie
On Feb 17, 1:40 am, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Lie wrote: > > Would all these problems with floating points be a rational reason to > > add rational numbers support in Python or Py3k? (pun not intended) > > > I agree, there are some numbers that is ratio

Re: How about adding rational fraction to Python?

2008-02-16 Thread Lie
On Feb 17, 2:26 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 16, 1:35 pm, Lie <[EMAIL PROTECTED]> wrote: > > > Would all these problems with floating points be a rational reason to > > add rational numbers support in Python or Py3k? (pun not intended)

Re: How about adding rational fraction to Python?

2008-02-16 Thread Lie
On Feb 17, 4:25 am, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 16, 3:03 pm, Lie <[EMAIL PROTECTED]> wrote: > > > Although rationals have its limitations too, it is a much > > better choice compared to floats/Decimals for most cases. > > Maybe that's t

Re: How about adding rational fraction to Python?

2008-02-17 Thread Lie
> Consider what happens when you add two fractions: > > 1/2 + 1/5 > > To do that, you have to take the LCD of the denomintor, in this case > 10, so you get > > 5/10 + 2/10 = 7/10 > > Now imagine that you're adding a lot of different numbers with a lot > of different bases. That LCD's going to be p

Re: Passing a callable object to Thread

2008-02-18 Thread Lie
On Feb 16, 12:29 pm, Jeff Schwab <[EMAIL PROTECTED]> wrote: > Paul Rubin wrote: > > Jeff Schwab <[EMAIL PROTECTED]> writes: > >> Why not? They seem intuitive to me. I would find it weird if you > >> couldn't have 0-tuple, and even weirder if you couldn't have a > >> 1-tuple. Maybe my brain has

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-23 Thread Lie
On Feb 23, 4:02 pm, zaley <[EMAIL PROTECTED]> wrote: > On Feb 22, 11:06 pm, "Jesper" wrote: > > > > > Give PyScripter fromhttp://www.mmm-experts.com/atry > > > It is for Windows, though it is written in Delphi and not in C/C++ > > > /Jesper > > > "zaley" <[EMAIL PROTECTED]> skrev i en meddelelsene

Re: Is there a open souce IDE writen by C( C++) or partly writen by C( C++)?

2008-02-24 Thread Lie
On Feb 24, 11:23 am, zaley <[EMAIL PROTECTED]> wrote: > On Feb 24, 6:48 am, Ricardo Aráoz <[EMAIL PROTECTED]> wrote: > > > > > Lie wrote: > > > On Feb 23, 4:02 pm, zaley <[EMAIL PROTECTED]> wrote: > > >> On Feb 22, 11:06 pm, "Jesper&quo

Re: How about adding rational fraction to Python?

2008-02-24 Thread Lie
On Feb 18, 1:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 17, 1:45 pm, Lie <[EMAIL PROTECTED]> wrote: > > > > Any iteration with repeated divisions and additions can thus run the > > > denominators up.  This sort of calculation is pretty commo

Re: How about adding rational fraction to Python?

2008-02-24 Thread Lie
On Feb 25, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > Lie wrote: > > On Feb 18, 1:25 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > >> On Feb 17, 1:45 pm, Lie <[EMAIL PROTECTED]> wrote: > > >>>> Any iteration with repeated divisions

Re: How about adding rational fraction to Python?

2008-02-24 Thread Lie
On Feb 25, 1:21 am, Mark Dickinson <[EMAIL PROTECTED]> wrote: > On Feb 24, 1:09 pm, Lie <[EMAIL PROTECTED]> wrote: > > > And this limit is much lower than n!. I think it's sum(primes(n)), but > > I've got no proof for this one yet. > > It's the le

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 5:41 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 24 Feb 2008 10:09:37 -0800, Lie wrote: > > On Feb 25, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Lie wrote: > >> > On Feb 18, 1:25 pm, Carl Banks

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 5:41 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 24 Feb 2008 10:09:37 -0800, Lie wrote: > > On Feb 25, 12:46 am, Steve Holden <[EMAIL PROTECTED]> wrote: > >> Lie wrote: > >> > On Feb 18, 1:25 pm, Carl Banks

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 11:34 am, casevh <[EMAIL PROTECTED]> wrote: > On Feb 24, 7:56 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > But that doesn't mean they become less manageable than > > other unlimited precision usages. Did you see my example > > of the polynomial finder using Newton's Forward Difference

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 1:58 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > What part of "repeated additions and divisions" don't you understand? What part of additions and subtractions don't you understand? I'm invalidating half of your statement, the division part, but validating another half, the additions par

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 25, 11:18 pm, Carl Banks <[EMAIL PROTECTED]> wrote: > On Feb 25, 9:41 am, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > On Feb 25, 12:58�am, Carl Banks <[EMAIL PROTECTED]> wrote: > > > > On Feb 24, 10:56 pm, Mensanator <[EMAIL PROTECTED]> wrote: > > > > > But that doesn't mean they become

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 26, 9:02 pm, [EMAIL PROTECTED] wrote: > > That's creepy for people that are new to programming and doesn't know > > how CPUs work and are used to general mathematics. That means most > > people. As programming language are now more accessible to regular > > people without specialized Compute

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
I >was not aware of that. I guess I won't be going to Python 3 then. It's >great that Python wants to attract young, new programmers. Too bad >about us old farts I guess. Don't worry, Python would still have integer division (// - double slash), if you still prefer integer

Re: How about adding rational fraction to Python?

2008-02-26 Thread Lie
On Feb 26, 9:33 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Tue, 26 Feb 2008 04:29:18 -0800, Lie wrote: > >> J Cliff Dyer: > >> I'm in the camp that believes that 3/4 does indeed yield the integer 0, > >> but should be spelled 3

Re: How about adding rational fraction to Python?

2008-02-29 Thread Lie
On Feb 28, 10:00 am, Paul Rubin wrote: > More examples: > >x = 1 >y = len(s) + x > > => ok, decides that x is an int > >x = 1 >y = x + 3.0 > > => ok, decides that x is a float > >x = 1 >y = x + 3.0 >z = len(s) + x > > => forbidden, x cannot be

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Mar 1, 11:23 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: (snip) > But the type of `x` must be specialized somehow.  `x` doesn't start as > `Int` or `Integer` but the very generic and AFAIK abstract type class `Num`. > > After seeing the second line the compiler finds an implementatio

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Mar 2, 2:32 am, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Lie <[EMAIL PROTECTED]> writes: > > I see, but the same arguments still holds true: the second line have > > an implicit side-effect of redefining x's type into Fractional type. > > If I were t

Re: How about adding rational fraction to Python?

2008-03-01 Thread Lie
On Feb 29, 5:33 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > > > And rightly rejected by many other programming languages, including > > > modern Python, not to mention calculators, real mathematics and > > > common sense. > > > Lost me again.  I was not aware that calculator

Re: How about adding rational fraction to Python?

2008-03-02 Thread Lie
On Mar 2, 2:02 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Lie <[EMAIL PROTECTED]> writes: > > So basically they refused to satisfy everything that is still possible > > individually but would conflict if done together. > > I can't understand that. &

Re: How about adding rational fraction to Python?

2008-03-02 Thread Lie
On Mar 2, 10:02 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Lie <[EMAIL PROTECTED]> writes: > > Anyway, I don't think Python should > > work that way, because Python have a plan for numerical integration > > which would unify all numerical types i

Re: How about adding rational fraction to Python?

2008-03-03 Thread Lie
On Mar 2, 11:36 pm, Paul Rubin <http://[EMAIL PROTECTED]> wrote: > Lie <[EMAIL PROTECTED]> writes: > > You hit the right note, but what I meant is the numeric type > > unification would make it _appear_ to consist of a single numeric type > > (yeah, I know it isn&

Re: sympy: what's wrong with this picture?

2008-03-04 Thread Lie
On Mar 4, 1:12 pm, Mensanator <[EMAIL PROTECTED]> wrote: > On Mar 3, 11:58 pm, Erik Max Francis <[EMAIL PROTECTED]> wrote: > > > Mensanator wrote: > > > While we're on the subject of English, the word "worthless" > > > means "has no value". So, a program that doesn't work would > > > generally be "

Re: Converting a string to the most probable type

2008-03-08 Thread Lie
On Mar 8, 12:19 am, rockingred <[EMAIL PROTECTED]> wrote: > Dates can be a pain.  I wrote my own date program, simply because > there are so many different ways to write a date: > > Mar 8, 2008 > March 8th, 08 > 03/08/08 > 03-08-2008 > > And so on and so forth.  The tricky bit is how to tell the di

Re: Converting a string to the most probable type

2008-03-08 Thread Lie
On Mar 8, 8:34 am, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Fri, 07 Mar 2008 16:13:04 -0800, Paul Rubin wrote: > > Pierre Quentel <[EMAIL PROTECTED]> writes: > >> I would like to know if there is a module that converts a string to a > >> value of the "most probable type" >

Re: Regarding coding style

2008-03-08 Thread Lie
Personally I preferred a code that has chosen good names but have little or no comments compared to codes that makes bad names and have twenty pages of comments to read and understand what it's about. Personally, I think comments should be made as short and as concise as possible and codes should t

What c.l.py's opinions about Soft Exception?

2008-03-08 Thread Lie
I'm asking about people in c.l.py's opinion about a _probably_ very Pythonic way of doing something if such features is implemented. It is to be known that I'm not a Python expert and actually relatively new to Python programming, so probably I'm just not thinking pythonic enough yet or this featur

Re: Python installation problem

2008-03-08 Thread Lie
On Mar 9, 11:42 am, [EMAIL PROTECTED] wrote: > Hi Folks, > > I downloaded a pre-compiled version 2.5, and intalled it without any > error message; and I can command line playing on Python through firing > up IDLE or command-line. However, I just can't compile the python file > existing in a directo

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Lie
On Mar 9, 12:05 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 9 Mrz., 04:51, Lie <[EMAIL PROTECTED]> wrote: > > > A more through implementation would start from the raiser inspecting > > the execution stack and finding whether there are any try block above > &g

Re: Regarding coding style

2008-03-09 Thread Lie
On Mar 9, 3:27 am, [EMAIL PROTECTED] wrote: > To Lie: > > > Personally I preferred a code that has chosen good names but have > > little or no comments compared to codes that makes bad names and have > > Personally I don't.  Show me a good one.  Until you do, it'

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Lie
On Mar 9, 6:57 pm, Bryan Olson <[EMAIL PROTECTED]> wrote: > Lie wrote: > > [...]> Soft Exception is an exception that if is unhandled, pass silently as > > if nothing happened. > > [...] > > > Implementation: > > Simple implementation might be done

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Lie
On Mar 9, 4:31 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > On 9 Mrz., 09:30, Lie <[EMAIL PROTECTED]> wrote: > > On Mar 9, 12:05 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: > > > > On 9 Mrz., 04:51, Lie <[EMAIL PROTECTED]> wrote: > > > > &g

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Lie
On Mar 9, 7:54 pm, Steven D'Aprano <[EMAIL PROTECTED] cybersource.com.au> wrote: > On Sun, 09 Mar 2008 00:30:51 -0800, Lie wrote: > > (3) Informing codes above it about what's currently happening inside, > > the thing is just a mundane report that might be useful t

Re: What c.l.py's opinions about Soft Exception?

2008-03-09 Thread Lie
On Mar 9, 9:29 pm, Kay Schluehr <[EMAIL PROTECTED]> wrote: (snip) > You are an appropriate person to consider the workflow in a dynamic > language, no matter how the language is implemented internally. I agree, but the only thing I'm not confident to talk about is how it'll be implemented, since I

Re: What c.l.py's opinions about Soft Exception?

2008-03-10 Thread Lie
On Mar 10, 12:12 pm, John Nagle <[EMAIL PROTECTED]> wrote: > Steven D'Aprano wrote: > > On Sat, 08 Mar 2008 22:24:36 -0800, Kay Schluehr wrote: > > >> On 9 Mrz., 06:30, Steven D'Aprano <[EMAIL PROTECTED] > >> cybersource.com.au> wrote: > >> Is it really so exotic that it requires the demand for mor

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Lie
On Mar 11, 2:18 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > > The problem with callbacks is that it works only for a small amount of > > callbacks, it'd be too messy to have twenty different callbacks. > > And the ultimate problem with callbacks is that we can't determine > > from the outsi

Re: __iter__ yield

2008-03-11 Thread Lie
On Mar 10, 3:58 am, duccio <[EMAIL PROTECTED]> wrote: > Hello! > Someone knows if it's possible to make this __iter__ function with just > one 'yield' intead of two? > Is there some simpler way to make this __iter__ iter through all nodes? > Thanks! > > class Node: > def __init__(self, data=N

Re: Regarding coding style

2008-03-11 Thread Lie
On Mar 10, 4:16 am, [EMAIL PROTECTED] wrote: > On Mar 9, 4:25 am, Lie <[EMAIL PROTECTED]> wrote: > > > On Mar 9, 3:27 am, [EMAIL PROTECTED] wrote: > > > > To Lie: > > > > > Personally I preferred a code that has chosen good names but have > > >

Re: How to factor using Python?

2008-03-11 Thread Lie
On Mar 10, 12:08 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > How do I factor a number? I mean how do I translate x! into proper > Python code, so that it will always do the correct math? > > Thanks in advance, > Nathan P. Factorial algorithm is a very simple and common algorithm, and it's one of

Re: How to factor using Python?

2008-03-11 Thread Lie
On Mar 11, 11:47 pm, Lie <[EMAIL PROTECTED]> wrote: > On Mar 10, 12:08 pm, Nathan Pinno <[EMAIL PROTECTED]> wrote: > > > How do I factor a number? I mean how do I translate x! into proper > > Python code, so that it will always do the correct math? > &g

Re: What c.l.py's opinions about Soft Exception?

2008-03-11 Thread Lie
(If there is anything weird that I say, please ignore it since I'm writing this half-sleeping) On Mar 12, 12:00 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: (snip) > I totally fail to see where > > raise Equal(a, b) > > is less cluttered or not than > > callback(a, b) > > Actually, the latte

Re: List mutation method gotcha - How well known?

2008-03-13 Thread Lie
On Mar 13, 2:36 pm, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > Hi, > > I am surprised that it took me so long to bloody my nose on this one. > > It must be well known - and I would like to find out how well known. > > So here is a CLOSED BOOK multiple choice question - no RTFM, > no playing

Re: List mutation method gotcha - How well known?

2008-03-14 Thread Lie
On Mar 14, 4:57 pm, Jarek Zgoda <[EMAIL PROTECTED]> wrote: > Lie napisa³(a): > > > > >> foo = [1,2,3,4] > >> x = foo.append(5) > >> print x > > >> What will be the output (choose one): > > >> 1)  [1,2,3,4] > >> 2)  [1,2,

Re: find string in file

2008-03-16 Thread Lie
On Mar 14, 8:25 pm, [EMAIL PROTECTED] wrote: > Hi friends !! > > I'm neophite about python, my target is to create a programa that > find  a specific string in text file. > How can do it? > > Thanks > fel I'd recommend regular expression (import re) if the string you're searching is in a complex f

Re: Convert int to float

2008-03-16 Thread Lie
On Mar 16, 4:43 am, Guido van Brakel <[EMAIL PROTECTED]> wrote: > Hello > > I have this now: > > > def gem(a): > >     g = sum(a) / len(a) > >     return g > > > print gem([1,2,3,4]) > > print gem([1,10,100,1000]) > > print gem([1,-2,3,-4,5]) > > It now gives a int, but i would like to see floats.

Re: List mutation method gotcha - How well known?

2008-03-16 Thread Lie
On Mar 15, 1:01 pm, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > On Fri, 14 Mar 2008 11:32:41 -0700, Lie wrote: > > No, there is no need for "void" return type, what I meant is that > > everything that's not said in the documentation should be

Re: Converting a string to the most probable type

2008-03-16 Thread Lie
On Mar 11, 4:15 am, John Machin <[EMAIL PROTECTED]> wrote: > On Mar 11, 3:19 am, [EMAIL PROTECTED] wrote: > > > The trick in the case of when you do not want to guess, or the choices > > grow too much, is to ask the user to tell you in what format they want > > it and format according to their wish

Re: Is this valid ?

2008-03-20 Thread Lie
On Mar 20, 4:18 am, Stef Mientki <[EMAIL PROTECTED]> wrote: > hello, > > by accident I typed a double value test, > and to my surprise it seems to work. > Is this valid ? > > a = 2 > b = 2 > > a == b == 2 > > thanks, > Stef Mientki a == b == 2 is equivalent to a == b and b == 2 except that b is on

Re: dividing tuple elements with an int or float

2008-03-23 Thread Lie
On Mar 20, 1:06 pm, royG <[EMAIL PROTECTED]> wrote: > hi > i am trying to resize some images.First i'd read the size as a 2 > tuple  and then i want to divide it by 2 or 4 or 2.5 etc.. > > suppose > origsz=(400,300) > i want to divide the origsize by 2.5 so i can resize to (160,120) There are seve

Re: dividing tuple elements with an int or float

2008-03-23 Thread Lie
On Mar 22, 2:23 pm, [EMAIL PROTECTED] wrote: > > Sane programmers don't write such semi-functional things (unless it > > helps expressing the problem in certain domains). > > I now think that deprecating map, lambda & Co. was a good thing after > > all. > > If you write it that way the first time,

Re: Is this doable

2008-03-23 Thread Lie
On Mar 22, 1:11 am, MRAB <[EMAIL PROTECTED]> wrote: > On Mar 21, 11:48 am, fkallgren <[EMAIL PROTECTED]> wrote:> Hi. > > > I have a little problem. I have a script that is in the scheduler > > (win32). But every now and then I update this script and I dont want > > to go to every computer and updat

Re: type conversion

2009-01-10 Thread Lie
On Jan 3, 10:23 am, r wrote: > On Jan 2, 7:46 pm, Steven D'Aprano > wrote: > > ...incessant rambling about a news reader , 101 excuses for butting > into a thread > [snip] ... public display of ignorance of newsgroup ethics, 101 excuses for not knowing proper terminologies. > Throw your newsre

Re: Is there a better algorithm?

2009-01-13 Thread Lie
On Jan 3, 4:38 am, mr wrote: > As has been noted, the best is to fix the input to be regular-3- > tuples. For the fun of it, here's another variation of a solution: > Yet another solution: for i in l: k, u, v = i[0], None if len(i) == 2 else i[1], i[-1] -- http://mail.python.org/mailman/li

Re: Is there a better algorithm?

2009-01-13 Thread Lie
On Jan 3, 11:55 am, Kottiyath wrote: > On Jan 3, 2:38 am, mr wrote: > > It is a code to post some data to HTML server. > Even though usually the POST values are of type(name, value), if file > transfer is involved, then POST values change to (name, filename, > value). > My view was that since fi

Re: why cannot assign to function call

2009-01-15 Thread Lie
On Jan 5, 9:03 am, Derek Martin wrote: > On Sat, Jan 03, 2009 at 10:15:51AM +, Marc 'BlackJack' Rintsch wrote: > > On Fri, 02 Jan 2009 04:39:15 -0600, Derek Martin wrote: > > > > On Tue, Dec 30, 2008 at 02:21:29PM +, John O'Hagan wrote: > > > What the Python community often overlooks, when

Re: why o/p is different ???

2009-01-16 Thread Lie
On Jan 15, 1:34 pm, asit wrote: > I recently faced a peculiar o/p. > > My objective is to remove the command name(my script name) from > sys.argv[0]. > I coded like this > > import urllib > import sys > > print "\n\n\t\tlipun4u[at]gmail[dot]com" > print "\t\t" > > apppath =

Re: Import without executing module

2009-02-03 Thread Lie
On Feb 3, 1:37 pm, Ray wrote: > I'll enclose the top-level commands with the if statement above...its > just a minor change, but it seems unavoidable. > > Thanks again! > > Ray If you really don't want the file to be changed, you could (depends on the module) use the module as a subprocess. The i

Re: Python 3D CAD -- need collaborators, or just brave souls :)

2009-02-19 Thread Lie
On Feb 18, 8:02 pm, r wrote: > Hello Josh, > Blender is a lost cause. It is a powerful app but the UI is horrible. > Even the Blender folks admit only a complete rewrite could solve the > major flaws that plague the design. So maybe i could salvage > some code > but for what i have in mind, Blend

Re: end of print = lower productivity ?

2008-11-29 Thread Lie
On Nov 25, 11:44 pm, Tim Chase <[EMAIL PROTECTED]> wrote: > > p = print > > p("f") > >> Voila, 4 keystrokes saved :-) > > > When I write "print", it is both effortless and instantaneous : my > > hands do not move, a wave goes through my fingers, it all happens in a > > tenth of a second. >

Re: end of print = lower productivity ?

2008-11-29 Thread Lie
On Nov 26, 3:08 am, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] schrieb: > > > > > On Nov 25, 5:05 pm, peter <[EMAIL PROTECTED]> wrote: > >> BUT you now can do > > > p = print > > p("f") > >> Voila, 4 keystrokes saved :-) > > > All right. Let's talk about that. > > > W

Re: Pyhon (with wxPython) on Windows' cygwin: can it be done fully ?

2008-11-29 Thread Lie
On Nov 26, 1:45 pm, "Barak, Ron" <[EMAIL PROTECTED]> wrote: > Hi Pythonistas, > > I read diaz's comments with interest, but - in my current configuration, I'm > unable to use pdb. > > I'm developing on cygwin and use wxPython. > Consequently, I cannot use native cygwin Python, but my Python is act

Re: Is there any project whose patches are all available?

2008-11-30 Thread Lie
On Nov 28, 1:57 pm, ZelluX <[EMAIL PROTECTED]> wrote: > Hi, all > > I want to write a version-tracking tool for Python projects, and need > some sample projects whose even smallest modifications can be > downloaded from the internet. > > Could you recommend some to me? > Thanks for your reply When

Re: HELP!...Google SketchUp needs a Python API

2008-11-30 Thread Lie
On Nov 28, 12:28 pm, r <[EMAIL PROTECTED]> wrote: > To think...that I would preach freedom to the slaves and be lynched > for it...IS MADNESS! > > Not one vote for Python, not a care. I think everyone here should look > deep within their self and realize the damage that has been done > today! I hop

  1   2   3   4   5   6   7   8   9   10   >