Python 3.0 — The Great Divide (2008)
Python · History & Evolution · Run with python3
Explanation
Python 3.0 ("Py3k") was released December 3, 2008. It deliberately broke backward compatibility to fix design warts that had accumulated over 17 years: `print` became a function, `unicode` became the default string type (`str`), integer division was fixed (`/` → float), and `range()` returned an iterator instead of a list. The division lasted over a decade — major libraries like NumPy and Django supported both `2.7` and `3.x` simultaneously until Python 2 EOL in 2020.
Real-World Scenario
`print "hello"` becoming `print("hello")` was trivially fixable. The real friction was Unicode — Python 2 had `str` (bytes) and `unicode` (text), with implicit conversion causing subtle bugs. Python 3 made the distinction explicit: `str` is always text, `bytes` is always binary. Every library that did I/O had to be rewritten.
Quick Snippet
# Python 3 string model — explicit text vs bytes
text = "café" # str: Unicode text
raw = b"caf\xc3\xa9" # bytes: encoded sequence
print(type(text)) # <class 'str'>
print(type(raw)) # <class 'bytes'>
print(text.encode("utf-8") == raw) # TrueFull Example
# Compile: python3 python3_changes.py
# Output:
# <class 'str'>
# <class 'bytes'>
# True
# 1.5
# 1
# Python 3 string model — str is Unicode text, bytes is raw binary
text = "café"
raw = "café".encode("utf-8")
print(type(text)) # <class 'str'>
print(type(raw)) # <class 'bytes'>
print(text.encode("utf-8") == raw) # True
# Python 3 integer division
print(3 / 2) # 1.5 (true division)
print(3 // 2) # 1 (floor division)
python3 python3_changes.py