Python Create Function Inside A Struct