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

drop py35 and py36 #1203

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open

drop py35 and py36 #1203

wants to merge 14 commits into from

Conversation

trim21
Copy link
Contributor

@trim21 trim21 commented Sep 11, 2024

drop python 35 and python 36 will make is possible to add inline typing, then we can commpile it with cython or mypyc.

@trim21 trim21 changed the title drop py35 and py36 so we can add inline typing drop py35 and py36 Sep 11, 2024
@Delgan
Copy link
Owner

Delgan commented Sep 22, 2024

Thanks @trim21 for your hard work here. I haven't tested how well type Mypyc and Cython leverage type hints. If it could indeed lead to faster execution, it would be a very compelling reason to add inline typing to the codebase.

However, I'm still in favor of maintaining support for Python 3.5. Even though it reached "End-of-life" status, these versions are still in-use and I'd like to continue releasing bug fixes and enhancements for them.

Is this a major obstacle to adding type hints, despite the existence of backporting libraries like typing_extensions?

@trim21
Copy link
Contributor Author

trim21 commented Sep 22, 2024

Is this a major obstacle to adding type hints, despite the existence of backporting libraries like typing_extensions?

Normally I wouldn't recommand to drop old python support for typing because we already have typing_extensions, but py35 and py36 are special.

Inline type annotation are new syntax, not new stdlib function/variable can be backported by library.

Mypyc and Cython

they doesn't work will without typing message....

@Delgan
Copy link
Owner

Delgan commented Sep 22, 2024

Inline type annotation are new syntax, not new stdlib function/variable can be backported by library.

It the "inline type annotation" you're referring to that of PEP 484?
Except if I'm missing something, it is compatible with Python 3.5

The following code is valid syntax:

def foo(a: int, b: int) -> int:
  d: int = 4
  return a + b + d
  
print(foo(3, 2))

@trim21
Copy link
Contributor Author

trim21 commented Sep 22, 2024

Inline type annotation are new syntax, not new stdlib function/variable can be backported by library.

It the "inline type annotation" you're referring to that of PEP 484? Except if I'm missing something, it is compatible with Python 3.5

The following code is valid syntax:

def foo(a: int, b: int) -> int:
  d: int = 4
  return a + b + d
  
print(foo(3, 2))
~/.pyenv/versions/3.5.10/bin/python a.py
  File "a.py", line 2
    d: int = 4
     ^
SyntaxError: invalid syntax

I think it need at least py36

@Delgan
Copy link
Owner

Delgan commented Sep 22, 2024

Apologies. I used an online interpreter that claims to be on version 3.5.2 but visibly is not.

@trim21
Copy link
Contributor Author

trim21 commented Sep 22, 2024

sorry, I didn't rember it correctly. Maybe we do not need to drop python36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants