numpy/numpy — pull request #3556 by arinkverma (2013-07-28 01:09:00+00:00)
Title: ENH: Avoiding conversion to NumPy Scalar. Implementation Copy-paste tag in conv_template.py

This pr is based on same rationale and improvement suggested in @raulcota 's pr #2941. For some types, it is a lot faster to just extract the value directly from the Python scalar. It take care of main concerned of code duplication.

Implementation of copy and paste tag in cove_template.py

Example
-------------
Here is demo template

/**begin copy
*@hi@
*/
Hello! This is just an dummy line
/**end copy**/

First I will write some useless line, then include code pasted to variable
hi as /**paste @hi@**/

Output:

First I will write some useless line, then include code pasted to variable
hi as Hello! This is just an dummy line

Usage
---------
Here, we could avoid duplicating the whole function body just to add one specific check as per dtype.