@@ -384,7 +384,30 @@ def expressions(cls, self, parameters, variable):
384
384
"""
385
385
return tuple (fun for dom , fun in parameters )
386
386
387
- def iteritems (cls , self , parameters , variable ):
387
+ def items (cls , self , parameters , variable ):
388
+ """
389
+ Iterate over the pieces of the piecewise function
390
+
391
+ .. NOTE::
392
+
393
+ You should probably use :meth:`pieces` instead, which
394
+ offers a nicer interface.
395
+
396
+ OUTPUT:
397
+
398
+ This method iterates over pieces of the piecewise
399
+ function, each represented by a pair. The first element is
400
+ the support, and the second the function over that
401
+ support.
402
+
403
+ EXAMPLES::
404
+
405
+ sage: f = piecewise([([0,0], sin(x)), ((0,2), cos(x))])
406
+ sage: for support, function in f.items():
407
+ ....: print('support is {0}, function is {1}'.format(support, function))
408
+ support is {0}, function is sin(x)
409
+ support is (0, 2), function is cos(x)
410
+ """
388
411
for pair in parameters :
389
412
yield pair
390
413
@@ -407,7 +430,7 @@ def __call__(cls, self, parameters, variable, value=None, **kwds):
407
430
"""
408
431
self = piecewise (parameters , var = variable )
409
432
substitution = dict ()
410
- for k , v in kwds .iteritems ():
433
+ for k , v in kwds .items ():
411
434
substitution [SR .var (k )] = v
412
435
if value is not None :
413
436
substitution [variable ] = value
@@ -896,7 +919,7 @@ def convolution(cls, self, parameters, variable, other):
896
919
uu = SR .var ('uu' )
897
920
conv = 0
898
921
fd ,f0 = parameters [0 ]
899
- gd ,g0 = other .iteritems (). next ( )
922
+ gd ,g0 = next ( other .items () )
900
923
if len (f )== 1 and len (g )== 1 :
901
924
f = f .unextend_zero ()
902
925
g = g .unextend_zero ()
0 commit comments