Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove python 3.9 support from pydiverse (both transform and pipedag) #227

Open
windiana42 opened this issue Oct 2, 2024 · 0 comments
Open
Labels
dependencies Pull requests that update a dependency file testing

Comments

@windiana42
Copy link
Member

We are considering to retire support for python 3.9. The main reason is that for typing unions with the pipe syntax (int | str), we need to do from __future__ import annotations, however, in case we want to analyze types in annotations, this is rather destructive because it converts the types to strings. Pydiverse transform might be first to retire 3.9. But then we might want to retire 3.9 from pydiverse pipedag on integrating the new transform version in tests.

# # try uncommenting:
# from __future__ import annotations

import inspect
import typing


def dec(fn):
    sig = inspect.signature(fn)

    def wrapper(*args, **kwargs):
        x = sig.bind(*args, **kwargs)
        print("types: " + str(typing.get_args(list(sig.parameters.values())[0].annotation)))
        return fn(*args, **kwargs)
    return wrapper

@dec
def f(a: typing.Union[int, str], **kwargs) -> int:
    return a

f(a=1)
@windiana42 windiana42 added dependencies Pull requests that update a dependency file testing labels Oct 2, 2024
@windiana42 windiana42 changed the title Retire python 3.9 Remove python 3.9 support from pydiverse (both transform and pipedag) Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file testing
Projects
None yet
Development

No branches or pull requests

1 participant