Re: except clause syntax question

2012-01-31 Thread Charles Yeomans
On Jan 31, 2012, at 7:12 PM, Terry Reedy wrote: > On 1/31/2012 8:57 AM, Charles Yeomans wrote: > >> In any case, though I appreciate your attempt at a post hoc justification, > > I was hoping for a positive explanation. > > I think the best you are going to get

Re: except clause syntax question

2012-01-31 Thread Charles Yeomans
On Jan 31, 2012, at 8:24 AM, Mel Wilson wrote: > Charles Yeomans wrote: > >> To catch more than one exception type in an except block, one writes >> >> except (A, B, C) as e: >> >> I'm wondering why it was decided to match tuples, but not lists: >&g

Re: except clause syntax question

2012-01-31 Thread Charles Yeomans
On Jan 31, 2012, at 11:38 AM, Devin Jeanpierre wrote: > On Tue, Jan 31, 2012 at 11:23 AM, Charles Yeomans > wrote: >> >> On Jan 31, 2012, at 9:51 AM, Steven D'Aprano wrote: >> >>> On Tue, 31 Jan 2012 08:57:31 -0500, Charles Yeomans wrote: >>> &g

Re: except clause syntax question

2012-01-31 Thread Charles Yeomans
On Jan 31, 2012, at 9:51 AM, Steven D'Aprano wrote: > On Tue, 31 Jan 2012 08:57:31 -0500, Charles Yeomans wrote: > >> I don't think of a tuple as a container, and I don't think it a >> misunderstanding on my part to think this. > > Well, it is a misunder

Re: except clause syntax question

2012-01-31 Thread Charles Yeomans
On Jan 30, 2012, at 7:00 PM, Steven D'Aprano wrote: > On Mon, 30 Jan 2012 12:41:00 -0500, Charles Yeomans wrote: > >> To catch more than one exception type in an except block, one writes >> >> except (A, B, C) as e: >> >> I'm wondering why

Re: except clause syntax question

2012-01-30 Thread Charles Yeomans
On Jan 30, 2012, at 12:56 PM, Aaron wrote: > On 01/30/2012 06:41 PM, Charles Yeomans wrote: >> To catch more than one exception type in an except block, one writes >> >> except (A, B, C) as e: >> >> I'm wondering why it was decided to match tuples, but n

except clause syntax question

2012-01-30 Thread Charles Yeomans
to "catch this single thing composed of three exception types". Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Exception class documentation

2010-02-06 Thread Charles Yeomans
On Feb 6, 2010, at 8:09 AM, Gerald Britton wrote: If you browse the Python source tree, you should be able to find it. http://svn.python.org/view/python/trunk/Objects/exceptions.c?revision=77045&view=markup Perfect (even if I have to read C). Thanks. Charles Yeomans --

Re: Exception class documentation

2010-02-05 Thread Charles Yeomans
On Feb 5, 2010, at 2:13 PM, Gerald Britton wrote: On Fri, Feb 5, 2010 at 12:55 PM, Charles Yeomans > wrote: I am so far unable to find the information I want about the Exception class. Information like the signature of __init__ seems to be unavailable. Any suggestions where I might f

Exception class documentation

2010-02-05 Thread Charles Yeomans
I am so far unable to find the information I want about the Exception class. Information like the signature of __init__ seems to be unavailable. Any suggestions where I might find such information? Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Q on explicitly calling file.close

2009-09-09 Thread Charles Yeomans
nally: f = f.close() In addition to fixing the latent bug in the second simple template, I took the opportunity to correct your heinous violation of command- query separation. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: why python got less developers ?

2009-08-28 Thread Charles Yeomans
faster all the time and languages like python or ruby are fast enough. any comment ? Many developers suffer from performance anxiety. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: How to create functors?

2009-08-20 Thread Charles Yeomans
sorts of functions and types (strictly "categories") they can accept, presumably to make them mathematically well-behaved. Have I got it correct? I don't think so. Paul Rubin's square example was, I thought, particularly instructive. Charles Yeomans-- http://mail.python.org/mailman/listinfo/python-list

Re: Programming by Contract

2009-08-14 Thread Charles Yeomans
On Aug 14, 2009, at 12:09 AM, Scott David Daniels wrote: Charles Yeomans wrote: On Aug 11, 2009, at 3:30 PM, Ethan Furman wrote: Ethan Furman wrote: Greetings! I have seen posts about the assert statement and PbC (or maybe it was DbC), and I just took a very brief look at pycontract (http

Re: Programming by Contract

2009-08-11 Thread Charles Yeomans
the input/output of functions; on the contrary, Bertrand Meyer, the inventor of DbC, claims that DbC allows one to eliminate such redundancy, and the resulting overhead. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-10 Thread Charles Yeomans
for enforcing pre-conditions and post- conditions, unless such conditions are mere "guidelines", because assert can be switched off at runtime. Unless, of course, you want to switch off such checking at runtime, as you might when using a design-by-contract approach. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: [0, 0, 0, 1, 1, 1, 0] ... remove all 0 values

2009-07-08 Thread Charles Yeomans
remove the first occurence. Doing that while no exception is raised is also uncool, right? Some suggestions? L = [0, 0, 0, 1, 1, 1, 0] M = [x for x in L if x !=0] Charles Yeomans-- http://mail.python.org/mailman/listinfo/python-list

Re: Clarity vs. code reuse/generality

2009-07-03 Thread Charles Yeomans
code as data sanitizing, but rather as a precondition. And with that description, the use of an assert statement that might be compiled away is not unreasonable; indeed, it certainly is so in the context of design by contract. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: XML(JSON?)-over-HTTP: How to define API?

2009-07-02 Thread Charles Yeomans
I figured some sort of HTTP event / RPC type of would be a good idea? Are there any modules I should know about, or guidelines I could read, that could aid me in the design of the API? Thank you, :) I'd suggest the O'Reilly book "RESTful Web Services". Cha

Re: PEP 376

2009-07-02 Thread Charles Yeomans
, MD5 was intended to be a cryptographic hash function, not a checksum. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Basic question from pure beginner

2009-07-01 Thread Charles Yeomans
ord: ") guess = str(guess) if guess != password: print "Access Denied" attemptcount = attemptcount + 1 else: print "Password Confirmed" correct_password_given = True break Charles Yeomans On Jul 1, 2009, at 3:58 AM, sato.ph...@gmail.com wro

Re: Running Invisible console Application

2009-06-29 Thread Charles Yeomans
On Jun 29, 2009, at 7:28 AM, Elf Scripter wrote: Hi, i have a console application that i want to ran (invisible) as a daemon, how can i do that? Search the web for python + daemon. I found plenty of code, including mostly prewritten solutions, for my own work. Charles Yemans -- http:/

Re: Beginning with Python; the right choice?

2009-06-27 Thread Charles Yeomans
is always evolving and there might be new tutorials out there. As an alternative to Python, I'd suggest REALbasic. Its main disadvantage is that it is not free. But you get a language, editor, and two application frameworks in one package. Charles Yeomans -- http://mail.python.org/mailman/

Re: Python simple web development

2009-06-26 Thread Charles Yeomans
Or you could try my approach and write your own web app. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring Fractal Dimension ?

2009-06-22 Thread Charles Yeomans
On Jun 22, 2009, at 2:16 PM, David C. Ullrich wrote: On Mon, 22 Jun 2009 10:31:26 -0400, Charles Yeomans wrote: On Jun 22, 2009, at 8:46 AM, pdpi wrote: On Jun 19, 8:13 pm, Charles Yeomans wrote: On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: Hmm. You left out a bit in the

Re: Measuring Fractal Dimension ?

2009-06-22 Thread Charles Yeomans
On Jun 22, 2009, at 8:46 AM, pdpi wrote: On Jun 19, 8:13 pm, Charles Yeomans wrote: On Jun 19, 2009, at 2:43 PM, David C. Ullrich wrote: Hmm. You left out a bit in the first definition you cite: "A simple closed curve J, also called a Jordan curve, is the image of a continuou

Re: Measuring Fractal Dimension ?

2009-06-20 Thread Charles Yeomans
ation. Ie, a curve in the plane _is_ a continuous function from an interval to the plane, and a subset of the plane is not a curve. Officially, anyway. This simply isn't true. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring Fractal Dimension ?

2009-06-19 Thread Charles Yeomans
atters, but his defintion of "polygonal path" is, _if_ we're being very careful, self-contradictory. So I don't think we can count that paper as a suitable reference for what the _standard_ definitions are; the standard definitions are not self-contradictory this way. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring Fractal Dimension ?

2009-06-18 Thread Charles Yeomans
On Jun 18, 2009, at 2:19 PM, David C. Ullrich wrote: On Wed, 17 Jun 2009 07:37:32 -0400, Charles Yeomans wrote: On Jun 17, 2009, at 2:04 AM, Paul Rubin wrote: Jaime Fernandez del Rio writes: I am pretty sure that a continuous sequence of curves that converges to a continuous curve

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Charles Yeomans
On Jun 17, 2009, at 9:43 PM, Steven D'Aprano wrote: On Wed, 17 Jun 2009 07:49:52 -0400, Charles Yeomans wrote: Even CPython doesn't rely completely on reference counting (it has a fallback gc for cyclic garbage). Python introduced the "with" statement to get away fro

Re: Exceptions and Object Destruction (was: Problem with apsw and garbage collection)

2009-06-17 Thread Charles Yeomans
ider this practice to be kludgy; my experience with RAII is pretty good. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: Measuring Fractal Dimension ?

2009-06-17 Thread Charles Yeomans
uniformly. On a closed interval, any continuous function is uniformly continuous. Isn't (-∞, ∞) closed? Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list

Re: preferring [] or () in list of error codes?

2009-06-08 Thread Charles Yeomans
he meaning of this: if a in (1,2,3): Actually, I might be -- I think of a tuple first as a single thing, as opposed to a list or map, which I see first as a collection of other things. Charles Yeomans -- http://mail.python.org/mailman/listinfo/python-list