~dinko-metalac/calculus-app2/trunk

« back to all changes in this revision

Viewing changes to lib/py/sympy/core/multidimensional.py

  • Committer: dinko.metalac at gmail
  • Date: 2015-04-14 13:28:14 UTC
  • Revision ID: dinko.metalac@gmail.com-20150414132814-j25k3qd7sq3warup
new sympy

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
Read the vectorize docstring for more details.
5
5
"""
 
6
from __future__ import print_function, division
 
7
 
6
8
from sympy.core.decorators import wraps
7
9
 
8
10
 
91
93
        If no argument is given, everything is treated multidimensional.
92
94
        """
93
95
        for a in mdargs:
94
 
            assert isinstance(a, (int, str))
 
96
            if not isinstance(a, (int, str)):
 
97
                raise TypeError("a is of invalid type")
95
98
        self.mdargs = mdargs
96
99
 
97
100
    def __call__(self, f):
105
108
            if self.mdargs:
106
109
                mdargs = self.mdargs
107
110
            else:
108
 
                mdargs = list(range(len(args))) + list(kwargs.keys())
 
111
                mdargs = range(len(args)) + kwargs.keys()
109
112
 
110
113
            arglength = len(args)
111
114