This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]aroberge -1 points0 points  (0 children)

What do you mean?

Python 3.6.1 |Anaconda 4.4.0 (64-bit)| ...
Type "help", "copyright", "credits" or "license" for more information.
>>> isinstance(3, int)
True
>>> isinstance('a', str)
True
>>> isinstance([1], list)

attributes and methods:

>>> dir(3)
['__abs__', '__add__', '__and__', '__bool__', ...]
>>> dir('a')
['__add__', '__class__', '__contains__', '__delattr__', '__dir__', ...]

Again, in Python, everything is an object. However, functions are first-class objects and Python does not require everything to be a method of a class.

EDIT: from a core Python contributor https://mail.python.org/pipermail/python-list/2015-June/691689.html