Google Groups Home Help | Sign in
Should the template system try to be a bit smarter about TypeError?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
James Bennett  
View profile
 More options May 7 2006, 5:28 pm
From: "James Bennett" <ubernost...@gmail.com>
Date: Sun, 7 May 2006 16:28:14 -0500
Local: Sun, May 7 2006 5:28 pm
Subject: Should the template system try to be a bit smarter about TypeError?
While trying to answer a question in the IRC channel today, I was
poking around in the template system and noticed that resolve_variable
has a comment about a particularly odd "gotcha": because it catches
and silently hides a TypeError raised by calling a method without the
appropriate number of arguments, it also ends up catching and silently
hiding a TypeError raised by something going wrong within the method
itself.

Out of curiosity, what's the reasoning for this? Would we incur a
significant performance penalty by looking at the exception to see
whether it's complaining about the number of arguments (in which case
it should not propagate) or whether something else has gone wrong and
raised a TypeError (in which case the exception probably should
propagate and result in a 500 error)?

--
"May the forces of evil become confused on the way to your house."
  -- George Carlin


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Kieran Holland  
View profile
 More options May 7 2006, 7:45 pm
From: "Kieran Holland" <kieran.holl...@gmail.com>
Date: Sun, 07 May 2006 23:45:25 -0000
Local: Sun, May 7 2006 7:45 pm
Subject: Re: Should the template system try to be a bit smarter about TypeError?
I don't understand why the TypeError needs to be caught at all.  If the
wrong number of arguments are passed then it seems to me that something
is genuinely broken - is there some reason to mask it?  FWIW I removed
that catch as part of #1400 and haven't missed it.

Kieran


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google