This repo is the skeleton for an exploratory, TDD-based course on Data Structures using Python. The series is based on Dave Astels' DBC Deep Dives, and adapted for implementation in, and of, the Python language.
I've done a bit of asking around, and attempted to adopt most commonly followed practices in the world of python testing. Tests are written using the built in unittest framework and run using nose. A few naming conventions might look different, because I've framed them around what I think is the best way to teach the material through TDD (and a bit of BDD).
- You'll need git, for cloning the repo:
- First, double check to see if you already have it:
git --version
- If you don't, visit this website for instructions.
- First, double check to see if you already have it:
- Make sure you have python installed, and check the version: this repo uses 2.x
python --version
will check the version you're using- if you're using python 3.x, and you don't already have a tool like pyenv installed, go ahead and install it. After it's installed, check out the docs for which commands will set up your environment.
-
don't forget [#3 in the installation instructions](https://github.com/yyuu/pyenv#basic-github-checkout. That's important.
-
try:
$> pyenv install 2.7.9 $> pyenv shell 2.7.9
-
- If this stuff doens't work for you (or if you're on windows- sorry) don't worry too much. These exercises should be compatible with python 3, but I can't guarantee that.
- install nose:
pip install nose
- First, clone the repo:
git clone https://github.com/celeen/PythonDataStructures.git
- Then choose the Data Structure you're exploring- take, for example, Lists.
- cd into the tests directory, and run
nosetests list_tests.py
- run
nosetests -v list_tests.py
for verbose output
- run
- confirm it runs, and that everything passes
- Find the related file in the main package, and delete its contents.
- run the tests again; confirm they run and that nothing passes.
- cd into the tests directory, and run
Happy Coding!
##Notes: ###Lists:
-You get remove()
and append()
for free. Please attempt to implement the others using these two.
-Thanks to @gotrhythm88 for noticing that the initial implementation of pop()
assumes there are no duplicates in the list. The tests have been changed, and a good solution is a WIP right now. Feel free to submit a pull reuqest if you've got one!
Any feedback is welcome in the form of PRs, issues, or emails. This is a work in progress.