Seeking review of an article about Python's origins

  • Context: Python 
  • Thread starter Thread starter harborsparrow
  • Start date Start date
  • Tags Tags
    article Review
Click For Summary

Discussion Overview

The discussion revolves around a request for feedback on an article about the origins of the Python programming language. Participants are examining the historical context and design decisions of Python, particularly regarding its object-oriented features and the introduction of the class statement.

Discussion Character

  • Debate/contested
  • Technical explanation

Main Points Raised

  • Some participants assert that Python was not designed to be object-oriented until version 3, claiming that earlier versions were more traditional scripting languages.
  • Others counter that Python has supported user-defined classes since early version 2, challenging the notion that object-oriented features were only added in version 3.
  • One participant expresses that the article reads like promotional material rather than an objective account.
  • There is a discussion about the explicit use of 'self' in Python methods, with some participants arguing that it was a design decision from the beginning, while others view it as an addition that feels tacked on compared to languages like Java.
  • Participants reference historical documentation and version release notes to support their claims about the class statement's introduction and the evolution of Python's design.
  • Some participants share their personal experiences with Python, noting that their exposure to earlier versions may have been limited, which influences their understanding of the language's development.

Areas of Agreement / Disagreement

Participants express conflicting views regarding the timeline and nature of Python's object-oriented capabilities, with no consensus reached on whether these features were integral from the start or introduced later. The discussion remains unresolved with multiple competing perspectives.

Contextual Notes

Participants reference specific versions of Python and their features, but there are unresolved questions about the implications of these design choices and the historical context of Python's development.

harborsparrow
Gold Member
Messages
729
Reaction score
246
TL;DR
Kirby Urner has written a new article on the origins of Python, and we are looking for people to review and comment on the article.
Dear Python programmers,

There is a new article on the "origins of Python" at https://en.citizendium.org/wiki/Python_(programming_language)

The Citizendium is a partner site with Physics Forums (cross-linked); we are looking for Python programmers to review and comment on the new article (on its Discussion page). If you have time and interest, please go at it, and thanks in advance.

I've been following the various Python discussions on here. It is one of the few current languages I've never had cause to use much, so I will be interested to know what you all have to say. Or, you can leave your comments here and I will relay them to Kirby, the article's author, from this forum.

Thanks in advance,

Pat
 
  • Like
Likes   Reactions: berkeman
Technology news on Phys.org
Well I see one glaring error. Python wasn’t designed to be OO until version 3 and classes were introduced. Earlier pythons were more traditional scripting languages.

I could be wrong but in 3 when I saw the self addition explicitly needed for each class and it’s attributes, I felt that OO was tacked on to python.
 
It reads like ad copy.
 
  • Like
Likes   Reactions: jedishrfu
jedishrfu said:
Python wasn’t designed to be OO until version 3 and classes were introduced.

This is not correct. Python has had the class statement, allowing user-defined classes and instances of them, since at least early in version 2. (I have been programming in Python since version 2.3, and I was using the class statement then.) Even "new-style classes", which are the only kind of classes in Python 3, were introduced midway in version 2 (version 2.4 or 2.5, I think).

jedishrfu said:
in 3 when I saw the self addition explicitly needed for each class and it’s attributes

I have no idea what you are talking about here. Explicit self for class attributes and methods has been required in Python ever since the class statement was introduced, early in version 2. They were certainly not something new that was added in version 3, any more than the class statement itself.
 
Interesting thanks for the clarification on the class statement. From my experience though I didn’t see it used in any scripts unless they were v3 based. My apologies.

The self comment is because of my background in java where self is not an explicit argument in any instance method like it is in python. To my mind it was tacked on to the language as opposed to baked into the design of the language. I haven’t found a reason for this convention.
 
jedishrfu said:
To my mind it was tacked on to the language as opposed to baked into the design of the language.

No, it wasn't, it was a deliberate design decision from the beginning.

jedishrfu said:
I haven’t found a reason for this convention.

The short version is one of the items from the Zen of Python: Explicit is better than implicit. In a language like C++ or Java, with an implicit "this", you can't tell just from looking at a variable reference inside a member function whether it is a reference to an instance variable or to a global defined elsewhere. In a member function in Python, you know exactly which variable references are to instance variables just by looking at them: the ones with self.

There is also the issue that, if a "self" parameter is implicit, the interpreter has to figure out when to add it to a function. Since Python allows methods to be dynamically added to classes after they are defined, this is not at all straightforward the way it is in C++ or Java.

For some discussion of the explicit self convention (including a discussion of the issue I just described) by Guido van Rossum, see here:

http://neopythonic.blogspot.com/2008/10/why-explicit-self-has-to-stay.html
 
  • Like
Likes   Reactions: jbunniii
jedishrfu said:
From my experience though I didn’t see it used in any scripts unless they were v3 based.

Python libraries and programs that use user-defined classes have been around as long as Python has. The Python standard library itself contains many of them, and has since the earliest versions.

If you haven't been programming in Python for many years, it's quite likely that your experience of Python prior to v3 overall is very limited. Python 3 has been around since 2008 and has been gaining traction steadily since about 2012 or so, when Python 3.3 was released--that was the first Python 3 version that was actually more usable than Python 2 and fixed enough of the mistakes made in earlier Python 3 versions to make people seriously consider starting to migrate legacy code.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
Replies
54
Views
8K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 21 ·
Replies
21
Views
2K
  • · Replies 13 ·
Replies
13
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 7 ·
Replies
7
Views
3K
Replies
5
Views
5K