Python Structure Like Function