~jtaylor/ubuntu/precise/python-numpy/multiarch-fix-818867

« back to all changes in this revision

Viewing changes to numpy/core/code_generators/generate_umath.py

  • Committer: Bazaar Package Importer
  • Author(s): Sandro Tosi
  • Date: 2010-10-07 10:19:13 UTC
  • mfrom: (7.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20101007101913-8b1kmt8ho4upcl9s
Tags: 1:1.4.1-5
* debian/patches/10_use_local_python.org_object.inv_sphinx.diff
  - fixed small typo in description
* debian/patches/changeset_r8364.diff
  - fix memory corruption (double free); thanks to Joseph Barillari for the
    report and to Michael Gilbert for pushing resolution; Closes: #581058

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
import re, textwrap
2
 
import sys, os
 
1
import os
 
2
import re
 
3
import struct
 
4
import sys
 
5
import textwrap
 
6
 
3
7
sys.path.insert(0, os.path.dirname(__file__))
4
8
import ufunc_docstrings as docstrings
5
9
sys.path.pop(0)
8
12
One = "PyUFunc_One"
9
13
None_ = "PyUFunc_None"
10
14
 
 
15
# Sentinel value to specify that the loop for the given TypeDescription uses the
 
16
# pointer to arrays as its func_data.
 
17
UsesArraysAsData = object()
 
18
 
 
19
 
11
20
class TypeDescription(object):
12
 
    """Type signature for a ufunc
 
21
    """Type signature for a ufunc.
13
22
 
14
23
    Attributes
15
24
    ----------
16
 
 
17
 
    type: character representing the type
18
 
    func_data:
19
 
    in_:
20
 
    out:
 
25
    type : str
 
26
        Character representing the nominal type.
 
27
    func_data : str or None or UsesArraysAsData, optional
 
28
        The string representing the expression to insert into the data array, if
 
29
        any.
 
30
    in_ : str or None, optional
 
31
        The typecode(s) of the inputs.
 
32
    out : str or None, optional
 
33
        The typecode(s) of the outputs.
21
34
    """
22
35
    def __init__(self, type, f=None, in_=None, out=None):
23
36
        self.type = type
24
37
        self.func_data = f
25
38
        if in_ is not None:
26
 
            in_ = in_.replace('.', type)
 
39
            in_ = in_.replace('P', type)
27
40
        self.in_ = in_
28
41
        if out is not None:
29
 
            out = out.replace('.', type)
 
42
            out = out.replace('P', type)
30
43
        self.out = out
31
44
 
32
45
    def finish_signature(self, nin, nout):
94
107
        for td in self.type_descriptions:
95
108
            td.finish_signature(self.nin, self.nout)
96
109
 
 
110
# String-handling utilities to avoid locale-dependence.
 
111
 
 
112
import string
 
113
UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
 
114
 
 
115
def english_upper(s):
 
116
    """ Apply English case rules to convert ASCII strings to all upper case.
 
117
 
 
118
    This is an internal utility function to replace calls to str.upper() such
 
119
    that we can avoid changing behavior with changing locales. In particular,
 
120
    Turkish has distinct dotted and dotless variants of the Latin letter "I" in
 
121
    both lowercase and uppercase. Thus, "i".upper() != "I" in a "tr" locale.
 
122
 
 
123
    Parameters
 
124
    ----------
 
125
    s : str
 
126
 
 
127
    Returns
 
128
    -------
 
129
    uppered : str
 
130
 
 
131
    Examples
 
132
    --------
 
133
    >>> from numpy.lib.utils import english_upper
 
134
    >>> english_upper('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_')
 
135
    'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
 
136
    >>> english_upper('')
 
137
    ''
 
138
    """
 
139
    uppered = s.translate(UPPER_TABLE)
 
140
    return uppered
 
141
 
 
142
 
97
143
#each entry in defdict is a Ufunc object.
98
144
 
99
145
#name: [string of chars for which it is defined,
123
169
              'D': 'cdouble',
124
170
              'G': 'clongdouble',
125
171
              'O': 'OBJECT',
126
 
              # M is like O, but calls a method of the object instead
 
172
              # '.' is like 'O', but calls a method of the object instead
127
173
              # of a function
128
 
              'M': 'OBJECT',
 
174
              'P': 'OBJECT',
129
175
              }
130
176
 
131
177
all = '?bBhHiIlLqQfdgFDGO'
132
178
O = 'O'
133
 
M = 'M'
 
179
P = 'P'
134
180
ints = 'bBhHiIlLqQ'
135
181
intsO = ints + O
136
182
bints = '?' + ints
137
183
bintsO = bints + O
138
184
flts = 'fdg'
139
185
fltsO = flts + O
140
 
fltsM = flts + M
 
186
fltsP = flts + P
141
187
cmplx = 'FDG'
142
188
cmplxO = cmplx + O
143
 
cmplxM = cmplx + M
 
189
cmplxP = cmplx + P
144
190
inexact = flts + cmplx
145
191
noint = inexact+O
146
 
nointM = inexact+M
147
 
allM = bints+flts+cmplxM
 
192
nointP = inexact+P
 
193
allP = bints+flts+cmplxP
148
194
nobool = all[1:]
149
 
nobool_or_obj = all[1:-1]
 
195
noobj = all[:-2]
 
196
nobool_or_obj = all[1:-2]
150
197
intflt = ints+flts
151
 
intfltcmplx = nobool_or_obj
 
198
intfltcmplx = ints+flts+cmplx
152
199
nocmplx = bints+flts
153
200
nocmplxO = nocmplx+O
154
 
nocmplxM = nocmplx+M
155
 
noobj = all[:-1]
 
201
nocmplxP = nocmplx+P
 
202
notimes_or_obj = bints + inexact
 
203
 
 
204
# Find which code corresponds to int64.
 
205
int64 = ''
 
206
uint64 = ''
 
207
for code in 'bhilq':
 
208
    if struct.calcsize(code) == 8:
 
209
        int64 = code
 
210
        uint64 = english_upper(code)
 
211
        break
156
212
 
157
213
defdict = {
158
214
'add' :
159
215
    Ufunc(2, 1, Zero,
160
216
          docstrings.get('numpy.core.umath.add'),
161
 
          TD(noobj),
 
217
          TD(notimes_or_obj),
 
218
          #[TypeDescription('M', UsesArraysAsData, 'Mm', 'M'),
 
219
          # TypeDescription('m', UsesArraysAsData, 'mm', 'm'),
 
220
          # TypeDescription('M', UsesArraysAsData, 'mM', 'M'),
 
221
          #],
162
222
          TD(O, f='PyNumber_Add'),
163
223
          ),
164
224
'subtract' :
165
225
    Ufunc(2, 1, Zero,
166
226
          docstrings.get('numpy.core.umath.subtract'),
167
 
          TD(noobj),
 
227
          TD(notimes_or_obj),
 
228
          #[TypeDescription('M', UsesArraysAsData, 'Mm', 'M'),
 
229
          # TypeDescription('m', UsesArraysAsData, 'mm', 'm'),
 
230
          # TypeDescription('M', UsesArraysAsData, 'MM', 'm'),
 
231
          #],
168
232
          TD(O, f='PyNumber_Subtract'),
169
233
          ),
170
234
'multiply' :
171
235
    Ufunc(2, 1, One,
172
236
          docstrings.get('numpy.core.umath.multiply'),
173
 
          TD(noobj),
 
237
          TD(notimes_or_obj),
174
238
          TD(O, f='PyNumber_Multiply'),
175
239
          ),
176
240
'divide' :
188
252
'true_divide' :
189
253
    Ufunc(2, 1, One,
190
254
          docstrings.get('numpy.core.umath.true_divide'),
191
 
          TD('bBhH', out='f'),
 
255
          TD('bBhH', out='d'),
192
256
          TD('iIlLqQ', out='d'),
193
257
          TD(flts+cmplx),
194
258
          TD(O, f='PyNumber_TrueDivide'),
196
260
'conjugate' :
197
261
    Ufunc(1, 1, None,
198
262
          docstrings.get('numpy.core.umath.conjugate'),
199
 
          TD(nobool_or_obj),
200
 
          TD(M, f='conjugate'),
 
263
          TD(ints+flts+cmplx),
 
264
          TD(P, f='conjugate'),
201
265
          ),
202
266
'fmod' :
203
267
    Ufunc(2, 1, Zero,
204
268
          docstrings.get('numpy.core.umath.fmod'),
205
269
          TD(ints),
206
270
          TD(flts, f='fmod'),
207
 
          TD(M, f='fmod'),
 
271
          TD(P, f='fmod'),
208
272
          ),
209
273
'square' :
210
274
    Ufunc(1, 1, None,
211
275
          docstrings.get('numpy.core.umath.square'),
212
 
          TD(nobool_or_obj),
 
276
          TD(ints+inexact),
213
277
          TD(O, f='Py_square'),
214
278
          ),
215
279
'reciprocal' :
216
280
    Ufunc(1, 1, None,
217
281
          docstrings.get('numpy.core.umath.reciprocal'),
218
 
          TD(nobool_or_obj),
 
282
          TD(ints+inexact),
219
283
          TD(O, f='Py_reciprocal'),
220
284
          ),
221
285
'ones_like' :
238
302
          TD(cmplx, out=('f', 'd', 'g')),
239
303
          TD(O, f='PyNumber_Absolute'),
240
304
          ),
 
305
'_arg' :
 
306
    Ufunc(1, 1, None,
 
307
          docstrings.get('numpy.core.umath._arg'),
 
308
          TD(cmplx, out=('f', 'd', 'g')),
 
309
          ),
241
310
'negative' :
242
311
    Ufunc(1, 1, None,
243
312
          docstrings.get('numpy.core.umath.negative'),
284
353
    Ufunc(2, 1, One,
285
354
          docstrings.get('numpy.core.umath.logical_and'),
286
355
          TD(noobj, out='?'),
287
 
          TD(M, f='logical_and'),
 
356
          TD(P, f='logical_and'),
288
357
          ),
289
358
'logical_not' :
290
359
    Ufunc(1, 1, None,
291
360
          docstrings.get('numpy.core.umath.logical_not'),
292
361
          TD(noobj, out='?'),
293
 
          TD(M, f='logical_not'),
 
362
          TD(P, f='logical_not'),
294
363
          ),
295
364
'logical_or' :
296
365
    Ufunc(2, 1, Zero,
297
366
          docstrings.get('numpy.core.umath.logical_or'),
298
367
          TD(noobj, out='?'),
299
 
          TD(M, f='logical_or'),
 
368
          TD(P, f='logical_or'),
300
369
          ),
301
370
'logical_xor' :
302
371
    Ufunc(2, 1, None,
303
372
          docstrings.get('numpy.core.umath.logical_xor'),
304
373
          TD(noobj, out='?'),
305
 
          TD(M, f='logical_xor'),
 
374
          TD(P, f='logical_xor'),
306
375
          ),
307
376
'maximum' :
308
377
    Ufunc(2, 1, None,
338
407
          docstrings.get('numpy.core.umath.logaddexp2'),
339
408
          TD(flts, f="logaddexp2")
340
409
          ),
 
410
# FIXME: decide if the times should have the bitwise operations.
341
411
'bitwise_and' :
342
412
    Ufunc(2, 1, One,
343
413
          docstrings.get('numpy.core.umath.bitwise_and'),
377
447
'degrees' :
378
448
    Ufunc(1, 1, None,
379
449
          docstrings.get('numpy.core.umath.degrees'),
380
 
          TD(fltsM, f='degrees'),
 
450
          TD(fltsP, f='degrees'),
381
451
          ),
382
452
'rad2deg' :
383
453
    Ufunc(1, 1, None,
384
454
          docstrings.get('numpy.core.umath.rad2deg'),
385
 
          TD(fltsM, f='rad2deg'),
 
455
          TD(fltsP, f='rad2deg'),
386
456
          ),
387
457
'radians' :
388
458
    Ufunc(1, 1, None,
389
459
          docstrings.get('numpy.core.umath.radians'),
390
 
          TD(fltsM, f='radians'),
 
460
          TD(fltsP, f='radians'),
391
461
          ),
392
462
'deg2rad' :
393
463
    Ufunc(1, 1, None,
394
464
          docstrings.get('numpy.core.umath.deg2rad'),
395
 
          TD(fltsM, f='deg2rad'),
 
465
          TD(fltsP, f='deg2rad'),
396
466
          ),
397
467
'arccos' :
398
468
    Ufunc(1, 1, None,
399
469
          docstrings.get('numpy.core.umath.arccos'),
400
470
          TD(inexact, f='acos'),
401
 
          TD(M, f='arccos'),
 
471
          TD(P, f='arccos'),
402
472
          ),
403
473
'arccosh' :
404
474
    Ufunc(1, 1, None,
405
475
          docstrings.get('numpy.core.umath.arccosh'),
406
476
          TD(inexact, f='acosh'),
407
 
          TD(M, f='arccosh'),
 
477
          TD(P, f='arccosh'),
408
478
          ),
409
479
'arcsin' :
410
480
    Ufunc(1, 1, None,
411
481
          docstrings.get('numpy.core.umath.arcsin'),
412
482
          TD(inexact, f='asin'),
413
 
          TD(M, f='arcsin'),
 
483
          TD(P, f='arcsin'),
414
484
          ),
415
485
'arcsinh' :
416
486
    Ufunc(1, 1, None,
417
487
          docstrings.get('numpy.core.umath.arcsinh'),
418
488
          TD(inexact, f='asinh'),
419
 
          TD(M, f='arcsinh'),
 
489
          TD(P, f='arcsinh'),
420
490
          ),
421
491
'arctan' :
422
492
    Ufunc(1, 1, None,
423
493
          docstrings.get('numpy.core.umath.arctan'),
424
494
          TD(inexact, f='atan'),
425
 
          TD(M, f='arctan'),
 
495
          TD(P, f='arctan'),
426
496
          ),
427
497
'arctanh' :
428
498
    Ufunc(1, 1, None,
429
499
          docstrings.get('numpy.core.umath.arctanh'),
430
500
          TD(inexact, f='atanh'),
431
 
          TD(M, f='arctanh'),
 
501
          TD(P, f='arctanh'),
432
502
          ),
433
503
'cos' :
434
504
    Ufunc(1, 1, None,
435
505
          docstrings.get('numpy.core.umath.cos'),
436
506
          TD(inexact, f='cos'),
437
 
          TD(M, f='cos'),
 
507
          TD(P, f='cos'),
438
508
          ),
439
509
'sin' :
440
510
    Ufunc(1, 1, None,
441
511
          docstrings.get('numpy.core.umath.sin'),
442
512
          TD(inexact, f='sin'),
443
 
          TD(M, f='sin'),
 
513
          TD(P, f='sin'),
444
514
          ),
445
515
'tan' :
446
516
    Ufunc(1, 1, None,
447
517
          docstrings.get('numpy.core.umath.tan'),
448
518
          TD(inexact, f='tan'),
449
 
          TD(M, f='tan'),
 
519
          TD(P, f='tan'),
450
520
          ),
451
521
'cosh' :
452
522
    Ufunc(1, 1, None,
453
523
          docstrings.get('numpy.core.umath.cosh'),
454
524
          TD(inexact, f='cosh'),
455
 
          TD(M, f='cosh'),
 
525
          TD(P, f='cosh'),
456
526
          ),
457
527
'sinh' :
458
528
    Ufunc(1, 1, None,
459
529
          docstrings.get('numpy.core.umath.sinh'),
460
530
          TD(inexact, f='sinh'),
461
 
          TD(M, f='sinh'),
 
531
          TD(P, f='sinh'),
462
532
          ),
463
533
'tanh' :
464
534
    Ufunc(1, 1, None,
465
535
          docstrings.get('numpy.core.umath.tanh'),
466
536
          TD(inexact, f='tanh'),
467
 
          TD(M, f='tanh'),
 
537
          TD(P, f='tanh'),
468
538
          ),
469
539
'exp' :
470
540
    Ufunc(1, 1, None,
471
541
          docstrings.get('numpy.core.umath.exp'),
472
542
          TD(inexact, f='exp'),
473
 
          TD(M, f='exp'),
 
543
          TD(P, f='exp'),
474
544
          ),
475
545
'exp2' :
476
546
    Ufunc(1, 1, None,
477
547
          docstrings.get('numpy.core.umath.exp2'),
478
548
          TD(inexact, f='exp2'),
479
 
          TD(M, f='exp2'),
 
549
          TD(P, f='exp2'),
480
550
          ),
481
551
'expm1' :
482
552
    Ufunc(1, 1, None,
483
553
          docstrings.get('numpy.core.umath.expm1'),
484
554
          TD(inexact, f='expm1'),
485
 
          TD(M, f='expm1'),
 
555
          TD(P, f='expm1'),
486
556
          ),
487
557
'log' :
488
558
    Ufunc(1, 1, None,
489
559
          docstrings.get('numpy.core.umath.log'),
490
560
          TD(inexact, f='log'),
491
 
          TD(M, f='log'),
 
561
          TD(P, f='log'),
492
562
          ),
493
563
'log2' :
494
564
    Ufunc(1, 1, None,
495
565
          docstrings.get('numpy.core.umath.log2'),
496
566
          TD(inexact, f='log2'),
497
 
          TD(M, f='log2'),
 
567
          TD(P, f='log2'),
498
568
          ),
499
569
'log10' :
500
570
    Ufunc(1, 1, None,
501
571
          docstrings.get('numpy.core.umath.log10'),
502
572
          TD(inexact, f='log10'),
503
 
          TD(M, f='log10'),
 
573
          TD(P, f='log10'),
504
574
          ),
505
575
'log1p' :
506
576
    Ufunc(1, 1, None,
507
577
          docstrings.get('numpy.core.umath.log1p'),
508
578
          TD(inexact, f='log1p'),
509
 
          TD(M, f='log1p'),
 
579
          TD(P, f='log1p'),
510
580
          ),
511
581
'sqrt' :
512
582
    Ufunc(1, 1, None,
513
583
          docstrings.get('numpy.core.umath.sqrt'),
514
584
          TD(inexact, f='sqrt'),
515
 
          TD(M, f='sqrt'),
 
585
          TD(P, f='sqrt'),
516
586
          ),
517
587
'ceil' :
518
588
    Ufunc(1, 1, None,
519
589
          docstrings.get('numpy.core.umath.ceil'),
520
590
          TD(flts, f='ceil'),
521
 
          TD(M, f='ceil'),
 
591
          TD(P, f='ceil'),
522
592
          ),
523
593
'trunc' :
524
594
    Ufunc(1, 1, None,
525
595
          docstrings.get('numpy.core.umath.trunc'),
526
596
          TD(flts, f='trunc'),
527
 
          TD(M, f='trunc'),
 
597
          TD(P, f='trunc'),
528
598
          ),
529
599
'fabs' :
530
600
    Ufunc(1, 1, None,
531
601
          docstrings.get('numpy.core.umath.fabs'),
532
602
          TD(flts, f='fabs'),
533
 
          TD(M, f='fabs'),
 
603
          TD(P, f='fabs'),
534
604
       ),
535
605
'floor' :
536
606
    Ufunc(1, 1, None,
537
607
          docstrings.get('numpy.core.umath.floor'),
538
608
          TD(flts, f='floor'),
539
 
          TD(M, f='floor'),
 
609
          TD(P, f='floor'),
540
610
          ),
541
611
'rint' :
542
612
    Ufunc(1, 1, None,
543
613
          docstrings.get('numpy.core.umath.rint'),
544
614
          TD(inexact, f='rint'),
545
 
          TD(M, f='rint'),
 
615
          TD(P, f='rint'),
546
616
          ),
547
617
'arctan2' :
548
618
    Ufunc(2, 1, None,
549
619
          docstrings.get('numpy.core.umath.arctan2'),
550
620
          TD(flts, f='atan2'),
551
 
          TD(M, f='arctan2'),
 
621
          TD(P, f='arctan2'),
552
622
          ),
553
623
'remainder' :
554
624
    Ufunc(2, 1, None,
560
630
    Ufunc(2, 1, None,
561
631
          docstrings.get('numpy.core.umath.hypot'),
562
632
          TD(flts, f='hypot'),
563
 
          TD(M, f='hypot'),
 
633
          TD(P, f='hypot'),
564
634
          ),
565
635
'isnan' :
566
636
    Ufunc(1, 1, None,
582
652
          docstrings.get('numpy.core.umath.signbit'),
583
653
          TD(flts, out='?'),
584
654
          ),
 
655
'copysign' :
 
656
    Ufunc(2, 1, None,
 
657
          docstrings.get('numpy.core.umath.copysign'),
 
658
          TD(flts),
 
659
          ),
 
660
'nextafter' :
 
661
    Ufunc(2, 1, None,
 
662
          docstrings.get('numpy.core.umath.nextafter'),
 
663
          TD(flts),
 
664
          ),
 
665
'spacing' :
 
666
    Ufunc(1, 1, None,
 
667
          docstrings.get('numpy.core.umath.spacing'),
 
668
          TD(flts),
 
669
          ),
585
670
'modf' :
586
671
    Ufunc(1, 2, None,
587
672
          docstrings.get('numpy.core.umath.modf'),
603
688
               'D': 'D_D',
604
689
               'G': 'G_G',
605
690
               'O': 'O_O',
606
 
               'M': 'O_O_method'}
 
691
               'P': 'O_O_method'}
607
692
 
608
693
chartotype2 = {'f': 'ff_f',
609
694
               'd': 'dd_d',
612
697
               'D': 'DD_D',
613
698
               'G': 'GG_G',
614
699
               'O': 'OO_O',
615
 
               'M': 'OO_O_method'}
 
700
               'P': 'OO_O_method'}
616
701
#for each name
617
702
# 1) create functions, data, and signature
618
703
# 2) fill in functions and data in InitOperators
619
704
# 3) add function.
620
705
 
621
 
# String-handling utilities to avoid locale-dependence.
622
 
 
623
 
import string
624
 
UPPER_TABLE = string.maketrans(string.ascii_lowercase, string.ascii_uppercase)
625
 
 
626
 
def english_upper(s):
627
 
    """ Apply English case rules to convert ASCII strings to all upper case.
628
 
 
629
 
    This is an internal utility function to replace calls to str.upper() such
630
 
    that we can avoid changing behavior with changing locales. In particular,
631
 
    Turkish has distinct dotted and dotless variants of the Latin letter "I" in
632
 
    both lowercase and uppercase. Thus, "i".upper() != "I" in a "tr" locale.
633
 
 
634
 
    Parameters
635
 
    ----------
636
 
    s : str
637
 
 
638
 
    Returns
639
 
    -------
640
 
    uppered : str
641
 
 
642
 
    Examples
643
 
    --------
644
 
    >>> from numpy.lib.utils import english_upper
645
 
    >>> english_upper('ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_')
646
 
    'ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_'
647
 
    >>> english_upper('')
648
 
    ''
649
 
    """
650
 
    uppered = s.translate(UPPER_TABLE)
651
 
    return uppered
652
 
 
653
 
 
654
706
def make_arrays(funcdict):
655
707
    # functions array contains an entry for every type implemented
656
708
    #   NULL should be placed where PyUfunc_ style function will be filled in later
674
726
            thedict = chartotype1  # one input and one output
675
727
 
676
728
        for t in uf.type_descriptions:
677
 
            if t.func_data is not None:
 
729
            if t.func_data not in (None, UsesArraysAsData):
678
730
                funclist.append('NULL')
679
731
                astr = '%s_functions[%d] = PyUFunc_%s;' % \
680
732
                       (name, k, thedict[t.type])
684
736
                           (name, k, t.func_data)
685
737
                    code2list.append(astr)
686
738
                    datalist.append('(void *)NULL')
687
 
                elif t.type == 'M':
 
739
                elif t.type == 'P':
688
740
                    datalist.append('(void *)"%s"' % t.func_data)
689
741
                else:
690
742
                    astr = '%s_data[%d] = (void *) %s;' % \
693
745
                    datalist.append('(void *)NULL')
694
746
                    #datalist.append('(void *)%s' % t.func_data)
695
747
                sub += 1
 
748
            elif t.func_data is UsesArraysAsData:
 
749
                tname = english_upper(chartoname[t.type])
 
750
                datalist.append('(void *)NULL')
 
751
                funclist.append('%s_%s_%s_%s' % (tname, t.in_, t.out, name))
 
752
                code2list.append('PyUFunc_SetUsesArraysAsData(%s_data, %s);' % (name, k))
696
753
            else:
697
 
                datalist.append('(void *)NULL');
 
754
                datalist.append('(void *)NULL')
698
755
                tname = english_upper(chartoname[t.type])
699
756
                funclist.append('%s_%s' % (tname, name))
700
757