Update ddt.py

minor refactor