TypeError: 'NoneType' object is not callable

Mel Wilson mwilson at the-wire.com
Tue Mar 16 11:59:03 EST 2004


In article <mailman.6.1079337283.12241.python-list at python.org>,
Atul Kshirsagar <atulkshirsagar at yahoo.com> wrote:
>I am observing that;
>As explained above when multiple threads are running.
>And as one of these threads finishes, in other running
>threads I start getting "TypeError: 'NoneType' object
>is not callable" error on the methods called on class
>objects in extention module.
>Does anyone know why this might be happening ? Is
>there any specific way I should be using Python and
>Extention modules in multi-threaded environment ?
>Any help is appreciated !!!

   I'm guessing here.  My test gets a different error
message:


Python 2.3 (#46, Jul 29 2003, 18:54:32) [MSC v.1200 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import types
>>> types.NoneType
<type 'NoneType'>
>>> n = types.NoneType()
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
TypeError: cannot create 'NoneType' instances


   The object None is intended to be unique, so it would
make sense if programs were forbidden from making more
instances of NoneType.

   Whatever route you've taken to get a reference to
types.NoneType which you then call is probably a mistake.

        Good Luck.      Mel.



More information about the Python-list mailing list