#347 Python: Wrappers for C functions that take no arguments should perform a no-argument check.

None
closed
None
5
2014-03-01
2014-02-26
Arnaud Diederen
No

Using SWIG 2.0.12

This patch fixes the issue discussed: https://sourceforge.net/p/swig/mailman/message/31957171/

The patch simply removes an unwanted check: wrappers for C functions that take no arguments should check that they, themselves, received no arguments.

Not doing is problematic for 2 reasons:
- incoherence: wrappers for functions with 1+ arguments check that they were passed the right number of arguments. There's no reason that wrappers for functions with 0 arguments don't behave the same.
- users can pass any set of arguments they want to those wrappers and they will be silently ignored, which can be misleading.

1 Attachments

Discussion

  • William Fulton
    William Fulton
    2014-03-01

    • status: open --> closed
    • assigned_to: William Fulton
    • Group: -->
     
  • William Fulton
    William Fulton
    2014-03-01

    Thanks, committed for SWIG-3.0.0