Creating Function In Class Python Init Method