Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Possible bug with TypeError in Python

From: Aaron Konstam <akonstam(at)sbcglobal.net>
Date: Wed Jan 30 2008 - 08:40:26 EST


The following seems like an bug in python in both f7 and f8 but I would like input before I post a bugzilla. It seems the exception handler cannot trap the TypeError in python.
For example:
def plus(a,b):

	try:
		return(a+b)
	except TypeError:
		return None

If we define plus as above and call it with: plus(3,) we should get nothing returned. Instead we get:
Traceback (most recent call last):
  File "./calculator", line 47, in <module>     exec("register=op[tokens[0]](register)")   File "<string>", line 1, in <module>
TypeError: plus() takes exactly 2 arguments (1 given)

This seems like a bug. An ideas out there?

--

=======================================================================
Please keep your hands off the secretary's reproducing equipment.
=======================================================================
Aaron Konstam telephone: (210) 656-0355 e-mail: akonstam@sbcglobal.net -- fedora-list mailing list fedora-list@redhat.com To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Received on Wed Jan 30 08:41:39 2008

This archive was generated by hypermail 2.1.8 : Sun May 25 2008 - 01:09:05 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library