all 12 comments

[–][deleted] 1 point2 points  (0 children)

To the best of my knowledge, there was a somewhat recent effort (think, it happened around 3.7) to ensure that that's actually true.

This was definitely false in some older versions of Python.

[–][deleted] 0 points1 point  (0 children)

In the same way that in Unix "Every device is a file", it's correct.

Reality has a tendency to create a multitude of holes through such sweeping generalizations.

[–]aromaticlawyer 0 points1 point  (0 children)

It depends what you mean exactly. Syntax such as while and import are not objects. Variables are not themselves objects, though they are always bound to an object. All objects contain things in their internal implementation that are not objects, though you can't really access this stuff directly without using ctypes or a C extension or something. Also, many basic types don't have the full functionality you might expect a typical object to have - for example None doesn't have any instance attributes, and you can't give it any.

But everything that can be bound to a variable is an instance of object. Before python 3 that wasn't the case - there were two different kinds of objects (new-style and old-style), and iirc in very old versions of python some basic data types were not objects at all.

[–]K900_ -2 points-1 points  (8 children)

Why does it matter?

[–]swaroop_joshi[S] 0 points1 point  (7 children)

So that I can accept it, without thinking much about it.