[Python-bugs-list] [ python-Bugs-814266 ] new.function raises TypeError for some strange reason...

SourceForge.net noreply at sourceforge.net
Mon Sep 29 01:31:05 EDT 2003


Bugs item #814266, was opened at 2003-09-29 01:31
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=814266&group_id=5470

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jeremy Fincher (jemfinch)
Assigned to: Nobody/Anonymous (nobody)
Summary: new.function raises TypeError for some strange reason...

Initial Comment:
Here's an example pasted directly from the interpreter: 
 
>>> def thread(f): 
...     """Makes sure a command spawns a thread when called.""" 
...     def newf(self, irc, msg, args, *L): 
...         ff = new.instancemethod(f, self, self.__class__) 
...         t = callbacks.CommandThread(self.callCommand, ff, irc, 
msg, args, *L) 
...         t.start() 
...     newf = new.function(newf.func_code, newf.func_globals, 
f.func_name) 
...     newf.__doc__ = f.__doc__ 
...     return newf 
... 
>>> import new 
>>> def groovy(): 
...   pass 
... 
>>> thread(groovy) 
Traceback (most recent call last): 
  File "<stdin>", line 1, in ? 
  File "<stdin>", line 7, in thread 
TypeError: arg 5 (closure) must be tuple 
 
Given that I didn't even give the (optional) arg 5, there's some bug 
here, even if it's only documentation/error message. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=814266&group_id=5470



More information about the Python-bugs-list mailing list