Brought to you by Michael and Brian - take a Talk Python course or get Brian's pytest book

#145: The Python 3 “Y2K” problem

Published Sat, Aug 31, 2019, recorded Wed, Aug 28, 2019

Sponsored by Datadog:

Special guests

Michael #1: friendly-traceback

  • via Jose Carlos Garcia (I think 🙂 )
  • Aimed at Python beginners: replacing standard traceback by something easier to understand
  • Shows help for exception type
  • Shows local variable values
  • Shows code in a cleaner form with more context
  • 3 ways to install
    • As an exception hook
    • Explicit explain
    • When running an app

Matt #2: Pandas Users Survey

  • Most use it almost everyday but have less than 2 years experience
  • Linux 61%, Windows 60%, Mac 42%
  • 93% Python 3

Anthony #3: python3 “Y2K” problem (python3.10 / python4.0)

  • with python3.8 close to release and python3.9 right around the corner, what comes after?
  • both python3.10 and python4.0 present some problems
    • sys.version[:3] which will suddenly report '``3.1``' in 3.10
    • a lot of code (including six.PY3!) uses sys.version_info[0] == 3 which will suddenly be false in python4.0 (and start running python2 code!)
  • early-to-mid 2020 we should start seeing the next version in the wild as python3.9 reaches beta
  • easy ways to start testing this early:
    • python3.10 - a build of cpython for ubuntu with the version number changed
    • flake8-2020 - a flake8 plugin which checks for these common issues-

Michael #4: pypi research

  • via Adam (Codependent Codr)
  • Really interesting research paper on the current state of Pypi from a couple authors at the University of Michigan: "An Empirical Analysis of the Python Package Index" -
  • Comprehensive empirical summary of the Python Package Repository, PyPI, including both package metadata and source code covering 178,592 packages, 1,745,744 releases, 76,997 contributors, and 156,816,750 import statements.
  • We provide counts and trends for packages, releases, dependencies, category classifications, licenses, and package imports, as well as authors, maintainers, and organizations.
  • Within PyPI, we find that the growth of the repository has been robust under all measures, with a compound annual growth rate of 47% for active packages, 39% for new authors, and 61% for new import statements over the last 15 years.
  • In 2005, there were 96 active packages, 96!
  • MIT is the most common license
  • (Matt) I saw this and was surprised at most commonly used libraries. What do you think the most common 3rd party library is?

Matt #5: DaPy

  • “Pandas for humans” - Matt’s words
  • Has portions of pandas, scikit-learn, yellowbrick, and numpy
  • Designed for “data analysis, not for coders”

Anthony #6: python-remote-pdb

  • very small over-the-network remote debugger
  • thin wrapper around pdb in a single file (easy to drop the file on PYTHONPATH if you can’t pip install)
  • not as fully featured as other remote debuggers such as pudb / rpdb / pycharm’s debugger but very easy to drop in
  • fully supports [breakpoint()]( (python3.7+ or via future-breakpoint)
  • access pdb via telnet / nc / socat
  • I’m using it to debug a text editor I’m writing to learn curses!






Michael: Two mathematicians are sitting at a table in a pub having an argument about the level of math education among the general public.

The one defending overall math knowledge gets up to go to the washroom. On the way back, he encounters their waitress and says, "I'll add an extra $10 to your tip, if you'll answer a question for me when I ask it. All you have to say is 'x-squared'." She agrees.

A few minutes later the populist mathematician says to his buddy, "I'll bet you $20 that even our waitress can tell us the integral of 2x." The cynic agrees to the bet.

So the schemer beckons the waitress to their table and asks the question, to which she replies "x-squared". As he begins to gloat and demand his winnings, the waitress continues, "Plus a constant."

Anthony: I had a golang joke prepared, but then I panic()d

Want to go deeper? Check our projects