import sys

if sys.version_info < (3, 10):  # Y066 When using if/else with sys.version_info, put the code for new Python versions first, e.g. "if sys.version_info >= (3, 10)"
    def foo(x): ...
else:
    def foo(x, *, bar=True): ...

if sys.version_info < (3, 8):  # Y066 When using if/else with sys.version_info, put the code for new Python versions first, e.g. "if sys.version_info >= (3, 8)"
    def bar(x): ...
elif sys.version_info < (3, 9):  # Y066 When using if/else with sys.version_info, put the code for new Python versions first, e.g. "if sys.version_info >= (3, 9)"
    def bar(x, *, bar=True): ...
elif sys.version_info < (3, 11):  # Y066 When using if/else with sys.version_info, put the code for new Python versions first, e.g. "if sys.version_info >= (3, 10)"
    def bar(x, *, bar=True, baz=False): ...
else:
    def bar(x, *, bar=True, baz=False, qux=1): ...


if sys.version_info >= (3, 5):
    ...
elif sys.version_info < (3, 9):  # Y066 When using if/else with sys.version_info, put the code for new Python versions first, e.g. "if sys.version_info >= (3, 10)"
    ...
else:
    ...

# Negative cases

if sys.version_info[0] == 2: ...
if sys.version_info[:1] == (2,): ...
if sys.version_info[:1] == (True,): ...
if sys.version_info < ('3', '0'): ...
if sys.version_info >= (3, 4, 3): ...
if sys.version_info == (3, 4): ...
if sys.version_info < (3, 5): ...
if sys.version_info >= (3, 5): ...
if (2, 7) <= sys.version_info < (3, 5): ...


if sys.version_info >= (3, 5):
    ...
else:
    ...

if sys.version_info >= (3, 10):
    def foo1(x, *, bar=True, baz=False): ...
elif sys.version_info >= (3, 9):
    def foo1(x, *, bar=True): ...
else:
    def foo1(x): ...

if sys.version_info < (3, 9):
    def foo2(x): ...
elif sys.version_info < (3, 10):
    def foo2(x, *, bar=True): ...
# no else case, no raise
