why not say just what wants an integer?

Anton Muhin antonmuhin at sendmail.ru
Wed Apr 23 04:45:10 EDT 2003


Dan Jacobson wrote:
> Say, does lack of ability to figure out how to make this work 
> $ python -c 'print range(map(lambda x:x+1,(11,131,11)))'
> Traceback (most recent call last):
>   File "<string>", line 1, in ?
> TypeError: an integer is required
> 
> indicate 1. newbie, 2. lazy newbie, 3. can't really blame me?
> 
> BTW, couldn't python be improved by saying just what wants an integer?
> 
> Yes, it happened after I added range(), so range wants the integer, I
> can tell that.  So list() won't help etc.
> 
> P.S. "pydoc print" gives nothing. Should it give some clue to the user
> wanting to know about "print", or is that some violation of principles?

Did you mean something like this:

print range(*map(lambda x:x+1,(11,131,11)))

anton.





More information about the Python-list mailing list