Re: Awsome Python - chained exceptions

2013-02-20 Thread rurpy
On 02/20/2013 04:50 AM, Steven D'Aprano wrote: >[...] > Or if your ISP provides Usenet access, you can use a News client to read it > via comp.lang.python, or gmane.comp.python.general. If you don't have a > News client, there are various free ones available, starting with > Thunderbird. I think v

RE: Awsome Python - chained exceptions

2013-02-20 Thread J. Marc Edwards
-list [mailto:python-list-bounces+marc.edwards=nimbisservices@python.org] On Behalf Of Rotwang Sent: Wednesday, February 20, 2013 11:01 AM To: python-list@python.org Subject: Re: Awsome Python - chained exceptions On 20/02/2013 11:50, Steven D'Aprano wrote: > > [...alternatives to Google...] &g

Re: Awsome Python - chained exceptions

2013-02-20 Thread Rotwang
On 20/02/2013 11:50, Steven D'Aprano wrote: [...alternatives to Google...] Or if your ISP provides Usenet access, you can use a News client to read it via comp.lang.python, or gmane.comp.python.general. And if it doesn't, you can get free Usenet access that includes most of the text-only gro

Re: Awsome Python - chained exceptions

2013-02-20 Thread Steven D'Aprano
alex23 wrote: > On Feb 20, 3:14 am, rusi wrote: >> How do you "revert to old interface"? >> So far I have managed to keep to the old by >> - logging out of gmail >> - reload GG -- now the choice to revert should appear >> >> It seems everyone does not get that option > > In an amazing piece of s

Re: Awsome Python - chained exceptions

2013-02-19 Thread alex23
On Feb 20, 3:14 am, rusi wrote: > How do you "revert to old interface"? > So far I have managed to keep to the old by > - logging out of gmail > - reload GG -- now the choice to revert should appear > > It seems everyone does not get that option In an amazing piece of software engineering, you ne

Re: Awsome Python - chained exceptions

2013-02-19 Thread rusi
On Feb 19, 7:18 am, alex23 wrote: > On Feb 18, 3:51 pm, Rick Johnson wrote: > > > I apologize for this doubling of my messages and i can assure you i > > don't do this intentionally. Proper netiquette is very important to me. > > These double posts are another unfortunate side-effect of using the

Re: Awsome Python - chained exceptions

2013-02-19 Thread rurpy
On 02/18/2013 07:18 PM, alex23 wrote: >[...] > Weird, I'm using GG too and not seeing any doubling of my messages. I > have reverted to using the old interface, though, so it might be a > side-effect of the new version they're hyping, which does seem to have > been designed by Satan himself (the wa

Re: Awsome Python - chained exceptions

2013-02-18 Thread alex23
On Feb 18, 3:51 pm, Rick Johnson wrote: > I apologize for this doubling of my messages and i can assure you i > don't do this intentionally. Proper netiquette is very important to me. > These double posts are another unfortunate side-effect of using the > buggy Google Groups web-face to read/write

Re: news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-18 Thread Terry Reedy
On 2/18/2013 1:32 PM, Rick Johnson wrote: 2. When positing a new message i must enter my email address and username each time. The forms are auto-filled for replys but not for new messages. Go figure! Using the newsreader interface, I get 1 email message per list to verify the email address.

Re: news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-18 Thread Rick Johnson
yahoo.com> writes: > On 02/17/2013 11:10 PM, Terry Reedy wrote: > > For at least the 10th time [...] > > And for at least the 11th time, you are wrong. There are reasons > (not applicable to everyone but applicable to many) for using > Google Groups, among others it is more accessible and easie

Re: news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-18 Thread rurpy
On 02/17/2013 11:10 PM, Terry Reedy wrote: > On 2/18/2013 12:51 AM, Rick Johnson wrote: > > if you (or anyone else) would be kind enough to recommend an > > alternative to this gawd awful software [google groups], > ? i'm all ears. My expectations at minimum are: > > For at least the 10th time,

Re: news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-18 Thread Kwpolska
On Mon, Feb 18, 2013 at 7:30 AM, Rick Johnson wrote: > Terry Reedy udel.edu> writes: >> For at least the 10th time, there is little to no excuse for reading and >> writing python-list thru google-groups. The news.gmane.org mirror has >> multiple interfaces: > > [Sent from gmane.comp.python.genera

Re: news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-17 Thread Rick Johnson
Terry Reedy udel.edu> writes: > For at least the 10th time, there is little to no excuse for reading and > writing python-list thru google-groups. The news.gmane.org mirror has > multiple interfaces: [Sent from gmane.comp.python.general] Yes you have mentioned this before and for some reason i

news.gmane.org (was Re: Awsome Python - chained exceptions

2013-02-17 Thread Terry Reedy
On 2/18/2013 12:51 AM, Rick Johnson wrote: > if you (or anyone else) would be kind enough to recommend an > alternative to this gawd awful software [google groups], ? i'm all ears. My expectations at minimum are: For at least the 10th time, there is little to no excuse for reading and writing p

Re: Awsome Python - chained exceptions

2013-02-17 Thread Rick Johnson
On Sunday, February 17, 2013 7:35:24 PM UTC-6, alex23 wrote: > Any chance you can stop sending to both comp.lang.python _and_ the > python-list, given the former is a mirror of the later? I apologize for this doubling of my messages and i can assure you i don't do this intentionally. Proper net

Re: Awsome Python - chained exceptions

2013-02-17 Thread Dave Angel
On 02/17/2013 08:35 PM, alex23 wrote: On Feb 15, 5:51 pm, Rick Johnson wrote: [Ranting nonsense that's appearing in duplicate on usenet] Any chance you can stop sending to both comp.lang.python _and_ the python-list, given the former is a mirror of the later? It might be easier to just tell

Re: Awsome Python - chained exceptions

2013-02-17 Thread alex23
On Feb 15, 5:51 pm, Rick Johnson wrote: [Ranting nonsense that's appearing in duplicate on usenet] Any chance you can stop sending to both comp.lang.python _and_ the python-list, given the former is a mirror of the later? -- http://mail.python.org/mailman/listinfo/python-list

Re: Awsome Python - chained exceptions

2013-02-15 Thread Serhiy Storchaka
On 14.02.13 08:39, Steven D'Aprano wrote: Here is one example of using raise to re-raise an exception you have just caught: import errno paths = ["here", "there", "somewhere else"] for location in paths: filename = os.path.join(location, "prefs.ini") try: f = open(filename)

Re: Awsome Python - chained exceptions

2013-02-15 Thread Ulrich Eckhardt
Am 15.02.2013 08:51, schrieb Rick Johnson: "How could a line in the "try" block ever be considered offensive?" My suggestion of "offensive" does not imply ignorance on /my/ part[...] Well, it seems to imply that you are not aware of the subtle difference between "offending" and "offensive".

Re: Awsome Python - chained exceptions

2013-02-14 Thread Rick Johnson
On Friday, February 15, 2013 12:18:17 AM UTC-6, Chris Angelico wrote: > And yet it is still a perfect example of how a line of > code inside a 'try' block can indeed be offensive. Oh nice try, but we are not fooled by your straw-man. My exact statement that provoked this whole thing was: """ Q1:

Re: Awsome Python - chained exceptions

2013-02-14 Thread Chris Angelico
On Fri, Feb 15, 2013 at 1:56 PM, Rick Johnson wrote: > On Thursday, February 14, 2013 6:01:51 AM UTC-6, Ulrich Eckhardt wrote: >> [...] >> >> try: >> rrick.go_and_[edit]_yourself() >> finally: >> rrick.get_lost() > > Oops, you forgot to catch "FloatingPointError" and so your code choked

Re: Awsome Python - chained exceptions

2013-02-14 Thread Rick Johnson
On Thursday, February 14, 2013 6:01:51 AM UTC-6, Ulrich Eckhardt wrote: > [...] > > try: > rrick.go_and_[edit]_yourself() > finally: > rrick.get_lost() Oops, you forgot to catch "FloatingPointError" and so your code choked in the try block -- typical newbie mistake. -- http://mail.pyt

Re: Awsome Python - chained exceptions

2013-02-14 Thread alex23
On Feb 14, 5:00 pm, Ian Kelly wrote: > 2. If you're going to criticize someone for their spelling, at least > be sure to spell correctly the name of the person you are addressing. > You've consistently misspelled Steven's surname in several posts that > I've noticed. The correct spelling conflict

Re: Awsome Python - chained exceptions

2013-02-14 Thread Ulrich Eckhardt
Am 13.02.2013 um 17:14 schrieb Rick Johnson: Q1: How could a line in the "try" block ever be considered offensive? Because it throws an error? try: rrick.go_and_fuck_yourself() finally: rrick.get_lost() See, wasn't that difficult, was it? :D Are you serious? No, I just coul

Re: Awsome Python - chained exceptions

2013-02-13 Thread Ian Kelly
On Tue, Feb 12, 2013 at 8:01 PM, Rick Johnson wrote: > On Tuesday, February 12, 2013 12:01:45 PM UTC-6, Zero Piraeus wrote: > >> You could call them PyW00ts. > > +1 on the name > -INFINITY on the execution > > Actually i am happy that DeAprano used the unintuitive tag now. Bad enough to > use an

Re: Awsome Python - chained exceptions

2013-02-13 Thread Steven D'Aprano
On Thu, 14 Feb 2013 09:10:42 +1100, Chris Angelico wrote: Quoting Rick Johnson: >> Q2: Why would the line in the try block be shown as a "feature" of >> the traceback when the whole intent of exception handling is to hide >> the error in the try block! If you want to raise the exception in t

Re: Awsome Python - chained exceptions

2013-02-13 Thread Chris Angelico
On Thu, Feb 14, 2013 at 3:14 AM, Rick Johnson wrote: > On Wednesday, February 13, 2013 12:58:46 AM UTC-6, Chris Angelico wrote: >> No, the offending (not offensive) line is "return items[index-1]", >> which doesn't feature in your traceback at all. > > Do you realize that you are quoting DeAprano

Re: Awsome Python - chained exceptions

2013-02-13 Thread Rick Johnson
On Wednesday, February 13, 2013 10:14:34 AM UTC-6, Rick Johnson wrote: > The proper method of using a forward compatible print > function is by /importing/ the feature. > >from future import print_function Urm... of course the proper /PROPER/ way would be to NOT throw an import error! f

Re: Awsome Python - chained exceptions

2013-02-13 Thread Rick Johnson
On Wednesday, February 13, 2013 12:58:46 AM UTC-6, Chris Angelico wrote: > On Wed, Feb 13, 2013 at 1:47 PM, Rick Johnson wrote: > >On Tuesday, February 12, 2013 12:15:29 AM UTC-6, Steven D'Aprano wrote: > >> If you've ever written an exception handler, you've probably written a > >> *buggy* excepti

Re: Awsome Python - chained exceptions

2013-02-12 Thread Michael Torrie
On Feb 13, 2013 12:00 AM, "Chris Angelico" wrote: > Which word? "we"? I'm not entirely sure, given that non-monospaced > fonts get in the way. Normally people would put exactly as many > carets/tildes as there are letters in the word, but aligning the text > in a mono font puts the carets under "

Re: Awsome Python - chained exceptions

2013-02-12 Thread Chris Angelico
On Wed, Feb 13, 2013 at 1:47 PM, Rick Johnson wrote: >On Tuesday, February 12, 2013 12:15:29 AM UTC-6, Steven D'Aprano wrote: >> If you've ever written an exception handler, you've probably written a >> *buggy* exception handler: >> >> def getitem(items, index): >> # One-based indexing. >>

Re: Awsome Python - chained exceptions

2013-02-12 Thread Michael Torrie
On 02/12/2013 07:47 PM, Rick Johnson wrote: > ...Oh Steven, if you only knew how we interpreted the "Oops!", more like > "Doh!". "You keep using that word. I do not think it means what you think it means." > Got any more bright ideas DeAprano? (Oh gawd tha

Re: Awsome Python - chained exceptions

2013-02-12 Thread Rick Johnson
On Tuesday, February 12, 2013 12:01:45 PM UTC-6, Zero Piraeus wrote: > You could call them PyW00ts. +1 on the name -INFINITY on the execution Actually i am happy that DeAprano used the unintuitive tag now. Bad enough to use an unintuitive tag. Worse to misspell it. But it would been a crime to

Re: Awsome Python - chained exceptions

2013-02-12 Thread Rick Johnson
On Tuesday, February 12, 2013 12:15:29 AM UTC-6, Steven D'Aprano wrote: > [snip inflammatory remarks] > I thought I'd present a few of Python's more > awesome features, starting with exception contexts. Well that's great idea, however, in order to find this very "valuable" information the searche

Re: Awsome Python - chained exceptions

2013-02-12 Thread Ethan Furman
On 02/12/2013 10:01 AM, Zero Piraeus wrote: On 12 February 2013 02:15, Steven D'Aprano wrote: As an antidote to the ill-informed negativity of Ranting Rick's illusionary "PyWarts", I thought I'd present a few of Python's more awesome features [...] You could call them PyW00ts. +1 QOTW -- ht

Re: Awsome Python - chained exceptions

2013-02-12 Thread Zero Piraeus
: On 12 February 2013 02:15, Steven D'Aprano wrote: > As an antidote to the ill-informed negativity of Ranting Rick's > illusionary "PyWarts", I thought I'd present a few of Python's more > awesome features [...] You could call them PyW00ts. -[]z. -- http://mail.python.org/mailman/listinfo/py

Re: Awsome Python - chained exceptions

2013-02-12 Thread Terry Reedy
On 2/12/2013 1:15 AM, Steven D'Aprano wrote: As an antidote to the ill-informed negativity of Ranting Rick's illusionary "PyWarts", I thought I'd present a few of Python's more awesome features, starting with exception contexts. You do not need Rick to justify such an informative post. If you

Awsome Python - chained exceptions

2013-02-11 Thread Steven D'Aprano
As an antidote to the ill-informed negativity of Ranting Rick's illusionary "PyWarts", I thought I'd present a few of Python's more awesome features, starting with exception contexts. If you've ever written an exception handler, you've probably written a *buggy* exception handler: def getitem

Re: Suppressing Implicit Chained Exceptions (Python 3.0)

2009-07-02 Thread andrew cooke
in control of the format_exc() call, I think the new chain keyword parameter can disable this and restore the old behavior. > > If you're not in control of the traceback display, I'm not sure there's an easy way to prevent it, given that displaying chained exceptions is the de

Re: Suppressing Implicit Chained Exceptions (Python 3.0)

2009-07-02 Thread David Bolen
nk the new chain keyword parameter can disable this and restore the old behavior. If you're not in control of the traceback display, I'm not sure there's an easy way to prevent it, given that displaying chained exceptions is the default mode. -- David -- http://mail.python.org/mailman/listinfo/python-list

Suppressing Implicit Chained Exceptions (Python 3.0)

2009-07-01 Thread andrew cooke
I have some (library) code where an exception is caught and, since the underlying cause is rather obscure, a different exception is raised that more clearly explains the issue to the caller. However, when printed via format_exc(), this new exception still has the old exception attached via the me

chained exceptions

2008-06-10 Thread Rowland Smith
Is anyone aware of a module or recipe for defining a composite/chained exception superclass? I've seen the PEP on chained exceptions wrt Python-3K, but I'm looking for something that is 2.5 compatible. -Rowland --- "The Dude abides." -