You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Generators/people.py doesn't run on Python 3 (print statements, xrange, time.clock, mem_profile) #232
Generators/people.py (companion to the Generators tutorial video) fails on every currently supported Python version:
print 'Memory (Before): ...' → SyntaxError: Missing parentheses in call to 'print' — Python 2 print statements fail at parse time, so the file can't even be imported.
xrange → NameError — removed in Python 3.
time.clock() → AttributeError — deprecated in 3.3, removed in 3.8.
import mem_profile → ModuleNotFoundError — this local helper module isn't included in the Generators folder, so the script fails even after fixing the syntax.
time.clock() → time.perf_counter() (the modern benchmarking clock)
mem_profile → inline memory_usage_mb() using psutil, keeping the same single third-party dependency the video used
1000000 → 1_000_000
The list vs. generator demo behaves identically: the list version shows the ~300+ MB memory jump, the generator version stays flat and returns instantly.
Happy to open a PR — either updating the file or adding a people_py3.py alongside it so the original stays in sync with the video.
Activity