python snippet tweaks