Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#230 Passing None to the constructor of a class when %implicitcon

None
closed
None
5
2013-08-29
2009-09-03
Bo Peng
No

Per discussing in https://sourceforge.net/mailarchive/forum.php?thread_name=6ea7b5430909010705g2ee7c6ej5ee79a9ce3826432%40mail.gmail.com&forum_name=swig-devel

I am writing to see if you could kindly have a look at the following
patch, which, instead of treating None always as NULL, passes NULL to
the constructor of a class when %implicitconv is defined. The
motivation of this patch is that I would like to make None a valid
input of a customized type but the way SWIG handles None makes it
impossible to pass None to the constructor of the class. I have
attached a simple example that demonstrates the current behavior. The
patch seems to work but I do not know any side effect of it.

Discussion

  • Bo Peng
    Bo Peng
    2009-09-03

    Patch

     
    Attachments
  • Bo Peng
    Bo Peng
    2009-09-03

    Note that this patch does not break any Python tests although I do not know how to properly test this new behavior in implicittest.i.

     
  • William Fulton
    William Fulton
    2013-08-29

    • status: open --> closed
    • assigned_to: William Fulton
    • Group: -->
     
  • William Fulton
    William Fulton
    2013-08-29

    This patch has been adapted for inclusion in swig-2.0.11. Thanks.