Simon Forman wrote: > > If you have a reason to restrict your code to using only ints (perhaps > you're packing them into an array of some sort, or passing them to a C > extension module) then yes, of course it's appropriate.
I politely disagree. Rather than an interface that demands an actual int, demand something that can be typecast as an int. For instance: def needsInt(i): i = int(i) ... pass i to an internal c function that requires an int ... # Or better yet, write your internal c function to take any Python object and cast it into an int. If you absolutely need a particular type of thing, then cast it into that thing. -- http://mail.python.org/mailman/listinfo/python-list