learning python ...
Manfred Lotz
ml_news at posteo.de
Tue May 25 12:49:18 EDT 2021
On Mon, 24 May 2021 08:14:39 +1200
Ron.Lauzon at f192.n1.z21.fsxnet (Ron Lauzon) wrote:
> -=> hw wrote to All <=-
>
> hw> Traceback (most recent call last):
> hw> File "[...]/hworld.py", line 18, in <module>
> hw> print(isinstance(int, float))
> hw> TypeError: isinstance() arg 2 must be a type or tuple of types
>
> hw> I would understand to get an error message in line 5 but not in
> hw> 18. Is this a bug or a feature?
>
> Python is case sensitive. Is that supposed to be "isInstance"?
>
>
This is easy to check
$ python3
Python 3.9.5 (default, May 14 2021, 00:00:00)
[GCC 11.1.1 20210428 (Red Hat 11.1.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> isinstance
<built-in function isinstance>
>>> isInstance
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'isInstance' is not defined
More information about the Python-list
mailing list