New submission from scott sadler <[EMAIL PROTECTED]>:

Calling a function created by _functools.partial as a method raises an
exception:

"TypeError: method_new() takes exactly n non-keyword arguments (0 given)"

Where method_new is the function passed into partial() and n is the
number of arguments it expects.

This does not happen when using a python version of partial().

Strangely, in the circumstance that I originally encountered the bug,
there was one instance that I was doing this and it _DID WORK_. The
function being passed into partial() was the same as in the place where
it was failing. The only significant difference that I could see was
that the input function to partial() was being imported, rather than
being defined in the same namespace as it was used I was unable to
reproduce it in my test case (attatched).

Tested on 2.6 and 2.5.2

----------
components: Extension Modules
files: partialbug.py
messages: 75928
nosy: ssadler
severity: normal
status: open
title: Can't use _functools.partial() created function as method
type: behavior
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file12017/partialbug.py

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue4331>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to