isPairPos and isSinglePos are mutually exclusive and isSinglePos is only defined if isPairPos is False so it is safe to use it in 'else' or 'elif' branches (logical expressions short-circuit)
if __name__ == "__main__"