#987 autodoc produce invalid code for static methods

closed-fixed
nobody
python (259)
5
2009-01-31
2009-01-31
No

This simple interface:

class itkImageUC2 {
public:
static itkImageUC2 * New();
};

produce the following invalid python code with swig 1.3.37, when invoke with the command line

swig -c++ -python -module toto -features autodoc=1 itkImage.i

def New(self):
"""New() -> itkImageUC2"""
return _toto.itkImageUC2_New(self)

if _newclass:New = staticmethod(New)

The method New() can't be called in python because it requires one argument.
Disabling the autodoc feature produce a valid python code:

if _newclass:New = staticmethod(_toto.itkImageUC2_New)

swig 1.3.36 produces valid python code with autodoc=1:

def New(*args):
"""New() -> itkImageUC2"""
return _toto.itkImageUC2_New(*args)

if _newclass:New = staticmethod(New)

Discussion

  • Haoyu Bai

    Haoyu Bai - 2009-01-31

    Fixed in trunk. Thanks for reporting! :)

     
  • Haoyu Bai

    Haoyu Bai - 2009-01-31
    • status: open --> closed-fixed
     
  • Gaetan Lehmann

    Gaetan Lehmann - 2009-01-31

    Works great now. Thanks for the very fast fix!

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks