I was wondering why many functions - especially in numpy - use tuples as function parameters?
eg:.
a = numpy.ones( (10, 5) )
What could be useful for this? Why not just have something like the following, as it is clear that the first parameters will always indicate the size of the array?
a = numpy.ones(10, 5)
Is it because there may be additional options like dtype? even if so
a = numpy.ones(10, 5, dtype=numpy.int)
seems to me a lot cleaner than using a collapsed tuple.
thank you for your responses
source share