Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Ask HN: What was Python 1 like?
14 points by kensai on May 6, 2017 | hide | past | favorite | 8 comments
I can hardly find any information or code snippets about it online. Has anyone worked with it? What were the drawbacks that led to Python 2?


https://www.python.org/download/releases/early/ has a tarball of Python 0.9.1. Andrew Dalke got it to compile on OS X and documented his changes in README.reconstructed.

The following is an excerpt from README.reconstructed.

Some quick differences from modern Python I found when using the resulting binary:

  - classes must have the (), as in
      class Spam():
        pass

  - There is no '__init__' function for instances. The
      classes in the library by convention use 'Create()'
      and that must be explicitly called.

  - The library code does not consistently use 'self'.

  - Only single quote strings 'like this' are allowed. "Double quoted"
      strings are not allowed.
Edited to add some details from README.reconstructed and credit the porter.


1.0 also added lambda, map, filter, and reduce.


Wow, that's even older than v1!


It barely registered for me at the time that Python had changed. But using it back then, it felt quite a bit similar between late 1.x and early 2.x, just with creature comforts gradually appearing and bulking up the language:

No decorators

Old-style classes(a distinction that makes almost no difference if you are using the class as a simple container with no inherited methods).

List comprehensions appeared in 2.0 and I struggled to grasp them for a little while.

The runtime might not have supported any cyclical reference collection(or I was just unaware at that point, being a student).

No iterators (2.1) or generators (2.2)

Python 1 to 2 was a simple transition, as it didn't do much to reassess the language's basics.


I remember no big changes, nor any breaking changes, from Python 1.5.2 to Python 2. The major version bump was mostly a marketing move. At that time, a 1.x.y version number didn't look mature enough for some companies.



The largest new feature in Python 2.0 is a new fundamental data type: Unicode strings. Unicode uses 16-bit numbers to represent characters instead of the 8-bit number used by ASCII, meaning that 65,536 distinct characters can be supported.

It's interesting that both Python 2.0 and Python 3.0 made fundamental changes to how the language deals with text.


I can see why they redid Unicode in 3.0, if that was their understanding of what Unicode was.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: