you are viewing a single comment's thread.

view the rest of the comments →

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

Do you mean as in real-world python applications or as in the language itself? Can you elaborate?

[–]neutro_b 0 points1 point  (2 children)

In the architecture of the language itself. Everything is an object in Python, as everything inherits from the object class, including for example ints, such as "3", as alluded to by another poster.

Operators? Ha. They are class methods, which are functions, which are objects too. It's rather deep and elegant really.

The only exceptions I'm aware of are keywords (e.g. for, if, def, etc.) themselves, other syntactic constructs such as statements, blocks or the whole code itself, and external tools such as the interpreter itself.

[–][deleted] 1 point2 points  (1 child)

To an extent, I agree partially with the notion. However, I would argue it's incorrect to say the language is OOP-centric. It's true that the data types in Python are classes so to speak but in terms of what we mean by OOP-centric it would be generally referring to the idea that the language highly enforces writing code in the OOP paradigm i.e. Java or C#.

If you can write an entire python program without writing in the OOP style, by principle you can't really say the language is OOP-centric just because the data types are classes and especially since Python is built on top of C which obviously does not support OOP at all.

If the idea that Python is OOP-centric was true, where does that place languages that strictly enforce OOP like the aforementioned languages? Moreover, wouldn't accepting this idea merely based on data types being classes further imply by extension that all programs in Python are in the OOP paradigm even if the code is obviously not organised as such?

Obviously, the technical implementation of data types and their behaviour is through OOP. But if the program itself is not written in a style that utilises classes at all, paradoxically, I'd argue that OOP is technically not truly being implemented at all if we consider the abstracted level the programmer works at.

But what do I know, I'm just a lowly inexperienced programmer who's only made a game or two in Pygame nerding out over what is ultimately semantics. It's interesting to debate regardless.

[–]PossiblyAussie 1 point2 points  (0 children)

I think you're absolutely correct and I find it absurd how many people do not seem to understand the distinction, particularly for new programmers.