Episode #128: Will the GIL be obsolete with PEP 554?
Sponsored by DigitalOcean: pythonbytes.fm/digitalocean
- Adam Johnson
- How to utilize pytest to set up quick test cases for coding challenges, like Project Euler or Advent of Code.
- Moving the specification and examples in the challenge description into test cases.
- Running the tests with a stub implementation and understanding the failure output.
- Gradually building up a working solution.
- Nice demo of how little code it takes to write quick test cases.
- Also a cool idea to use challenge sites and platforms as TDD/test first practice, as well as practice converting specifications into test cases.
Michael #2: DepHell -- project management for Python
- via @dreigelb
- Why it is better than all other tools:
- Format agnostic. You can use DepHell with your favorite format: setup.py, requirements.txt, Pipfile, poetry. DepHell supports them all and much more.
- Use your favorite tool on any project. Want to install a poetry based project, but don't like poetry? Just say DepHell to convert project meta information into setup.py and install it with pip. Or directly work with the project from DepHell, because DepHell can do everything what you usually want to do with packages.
- DepHell doesn't try to replace your favorite tools. If you use poetry, you have to use poetry's file formats and commands. However, DepHell can be combined with any other tool or even combine all these tools together through formats converting. You can use DepHell, poetry and pip at the same time.
- Easily extendable. Pipfile should be just another one supported format for pip. However, pip is really old and big project with many bad decisions, so, PyPA team can't just add new features in pip without fear to broke everything. This is how pipenv has been created, but pipenv has inherited almost all problems of pip and isn't extendable too. DepHell has strong modularity and can be easily extended by new formats and commands.
- Developers friendly. We aren't going to place all our modules into
[_internal](https://github.com/pypa/pip/tree/master/src/pip/_internal). Also, DepHell has big ecosystem with separated libraries to help you use some DepHell's parts without pain and big dependencies for your project.
- All-in-one-solution. DepHell can manage dependencies, virtual environments, tests, CLI tools, packages, generate configs, show licenses for dependencies, make security audit, get downloads statistic from pypi, search packages and much more. None of your tools can do it all.
- Smart dependency resolution. Sometimes pip and pipenv can't lock your dependencies. Try to execute
pipenv install oslo.utils==1.4.0. Pipenv can't handle it, but DepHell can:
dephell deps add --from=Pipfile oslo.utils==1.4.0to add new dependency and
dephell deps convert --from=Pipfile --to=Pipfile.lockto lock it.
- Asyncio based. DepHell doesn't support Python 2.7, and that allows us to use modern features to make network and filesystem requests as fast as possible.
- Multiple environments. You can have as many environments for project as you want. Separate sphinx dependencies from your main and dev environment. Other tools like pipenv and poetry don't support it.
Brian #3 Python rant: from foo import is bad
- Mike Croucher
- I’m glad to see this post because I’m still seeing this practice a lot, even in tutorial blog posts!
- This is meaningless:
result = sqrt(-1)
- Is it:
- Never do
from x import *
import numpy as np
- or even
from scipy import sqrt
- Never do
Michael #4: Dask
- Dask natively scales Python
- Have numpy, pandas, and scikit-learn code that needs to go faster?
- Run these on smart clusters of servers
- Or just on your laptop
- Process more data than will fit into RAM
- Supported by… interesting to see proper support there.
- Matthew Rocklin was on Talk Python 207 to discuss
Brian #5: Animations with Matplotlib
- Parul Pandey
- The raindrop simulation is mesmerizing.
- Tutorial on using
FuncAnimationto animate a sine wave
- although, I’m not sure what the x axis means during an animation
- live updates based on changing data
- animate turning a 3D plot
celluloidpackage to animate
- simple example
- animating subplots
- changing legend during animation
Michael #6: PEP 554 -- Multiple Interpreters in the Stdlib
- This proposal introduces the stdlib interpreters module. The module will be provisional. It exposes the basic functionality of subinterpreters already provided by the C-API, along with new (basic) functionality for sharing data between interpreters.
- Sharing data centers around "channels", which are similar to queues and pipes.
- Examples and use-cases:
- Running isolated code
- In process, true parallelism
- Versioning of modules (?)
- Plugin systems
- iOS Talk Python Training app is out: training.talkpython.fm/apps
- Find us at PyCon!
- Blessings terminal API (from Erik Rose, via Prayson Daniel)
via Topher Chung
- Knock knock.
- Race condition.
- Who's there?