Typescript Nested Class Python Syntax For If Else Statements