python template inheritance