pycon2016
pycon2016 copied to clipboard
Example code from the talk "Refactoring Python: Why and how to restructure your code" at PyCon 2016
Refactoring Python: Why and how to restructure your code
From the PyCon 2016 talk in Portland, OR (offical schedule link).
Slides are here (click image below to view):
Example code
Here are full Jupyter notebooks for each of the examples in the slides:
- [Example 1: Extract Variable & Function](Extract Variable.ipynb)
- [Example 2: Extract Class](Extract Class.ipynb)
- [Example 3: Extract Closure](Extract Method.ipynb)
To run the example code (must have Python3 installed):
- Download this repo
- Go into the repo directory on your local machine
-
pyvenv .
-
source bin/activate
-
pip3 install -r requirements.txt
-
jupyter notebook
- Control-C to kill the notebook when you're done
-
deactivate
to leave the Python environment
License
The code within is released under the Apache 2.0 License.