<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/1091" rel="nofollow">http://projects.scipy.org/numpy/ticket/1091</a> on 2009-04-22 by trac user mesmith, assigned to unknown.</em></p>
<p dir="auto">I want to re-open ticket <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="7725119" data-permission-text="Title is private" data-url="https://github.com/numpy/numpy/issues/1035" data-hovercard-type="issue" data-hovercard-url="/numpy/numpy/issues/1035/hovercard" href="https://github.com/numpy/numpy/issues/1035">#1035</a>. Here is the information that I submitted.</p>
<p dir="auto">I am re-opening this issue because the crackfortran patch does not appear to be redundant to me. The patch allows for setting the python callback argument as optional. I use it by adding the follow f2py declarations to the FORTRAN file where the python callback is called. [[BR]]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="c These lines are here to get the correct settings into flip.pyf
cf2py  intent(callback, hide) py_errmsg
cf2py optional py_errmsg
cf2py external py_errmsg
cf2py use gp_errmsg__user__routines"><pre class="notranslate"><code class="notranslate">c These lines are here to get the correct settings into flip.pyf
cf2py  intent(callback, hide) py_errmsg
cf2py optional py_errmsg
cf2py external py_errmsg
cf2py use gp_errmsg__user__routines
</code></pre></div>
<p dir="auto">[[BR]]<br>
where py_errmsg is a python callback function.</p>
<p dir="auto">Without the patch I get an error message from python when I attempt to execute the FORTRAN subroutine containing the python callback. [[BR]]</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TypeError: flip.gp_setdef() takes at least 1 argument (0 given)"><pre class="notranslate"><code class="notranslate">TypeError: flip.gp_setdef() takes at least 1 argument (0 given)
</code></pre></div>
<p dir="auto">[[BR]]<br>
where gp_setdef is the FORTRAN subroutine called from python and containing the cf2py lines above.</p>
<p dir="auto">I have tried numpy version 1.3 and the patch is still required. If there is another way to accomplish what I am trying to do without the patch--and without requiring the python callback function as an argument--I would like to know how to do it. The user base for our software is growing and the necessity of applying the patch for each installation is becoming unmanagable.</p>
<p dir="auto">I have updated the attached crackfortran.patch file for numpy 1.3.</p>
<p dir="auto">Thanks</p>
<p dir="auto"><em>Original ticket <a href="http://projects.scipy.org/numpy/ticket/437" rel="nofollow">http://projects.scipy.org/numpy/ticket/437</a> on 2007-01-29 by trac user mesmith, assigned to <a class="user-mention notranslate" data-hovercard-type="user" data-hovercard-url="/users/pearu/hovercard" data-octo-click="hovercard-link-click" data-octo-dimensions="link_type:self" href="https://github.com/pearu">@pearu</a>.</em></p>
<p dir="auto">I have a couple of changes I have made to f2py related to call backs that I would like to have included. I have been using these changes for over a year with no adverse side affects. Two attached patch files have the changes.</p>