What Is New in Python 1.2
Python 1.2 continued building out the standard library and refining the language core. The re module (regular expressions) received improvements, and the interpreter became more portable across Unix variants. Python 1.2 was part of the rapid iteration phase where the language was solidifying its core APIs.
| Category | Change | Notes |
|---|---|---|
| Standard Library | Improved regex and regsub for regular expressions |
Precursor to the modern re module |
| Standard Library | profile module for code profiling |
Pure-Python implementation of the profiler |
| Standard Library | Improved socket module for network programming |
More complete BSD socket API coverage |
| Standard Library | gzip module for gzip file reading and writing |
-- |
| Interpreter | Improved portability across Unix platforms | SunOS, HP-UX, IRIX, OSF/1 support |
| Language | Extended slice notation (seq[1:10:2] step support beginning here) |
Step (stride) support added to sequences |
Python 1.2 Context
Python 1.2 is a historical milestone. By this version, Python had a working object model, exception handling, modules, classes, standard library I/O primitives, and regular expression support. The language felt complete enough for serious use. The subsequent 1.3, 1.4, and 1.5 releases built on this foundation primarily by expanding the standard library and refining edge cases.
The profile module that arrived around this time established Python's tradition of providing performance profiling tools in the standard library -- a tradition that continues today with cProfile and tracemalloc.
FAQ
What was the original regular expression module in Python 1.x?
Python 1.x had the regex and regsub modules, which were based on an older POSIX-like regex implementation. They were replaced by the re module in Python 1.5, which used the PCRE-based engine, and then the SRE engine in 1.6. The old regex module was removed in Python 2.5.
Is the profile module still available in Python 3?
Yes. The pure-Python profile module and its C implementation cProfile are both in the Python 3 stdlib. cProfile should be preferred as it has significantly lower overhead. Both are used via python -m cProfile script.py or programmatically.
What does the step argument in slices do?
seq[start:stop:step] allows striding through a sequence. seq[::2] returns every other element. seq[::-1] reverses the sequence. Negative steps count backward. This is used extensively for list and string manipulation in modern Python.
How was Python installed in 1995?
Typically from source tarballs on Unix. You ran ./configure; make; make install. Binary distributions for Windows began appearing later in the 1.4-1.5 era. There was no pip, no virtual environments, no binary package distribution -- everything was either part of the stdlib or installed manually.
When did Python get a package manager?
The first package management tool was distutils (Python 1.6 / 2.0), which handled building and installing packages. PyPI (the Python Package Index) launched in 2003. easy_install came in 2004. pip appeared in 2008. CPython bundled pip by default starting in Python 3.4 (via PEP 453).