Re: Remove Py3.4 support in Cython 3.0?

40 views
Skip to first unread message

Stefan Behnel

unread,
Aug 14, 2021, 5:05:25 AM8/14/21
to cython...@python.org, Cython-users
This should also have gone to cython-users (not just cython-devel), as it
has the larger audience.

Stefan Behnel wrote:
> Hi,
>
> I looked up where Python 3.4 is still being used.
>
> Ubuntu 14.04 – EOS 2019, EOL April 2022
> Debian 8 – EOL
> Centos 6 – EOL
>
> Later distribution versions have newer CPythons:
>
> Ubuntu 16.04: Py3.5  (EOS April 2021, EOL 2024)
> Debian 9: Py3.5  (EOL June 2022)
> Centos 7: Py3.6  (EOL June 2024)
>
> I think we can safely drop Py3.4 support already for Cython 3.0.
>
> The advantage isn't big, since we still support Py2.7, but we can at least
> stop testing it, and start relying on the Py3.5 C-API for Py3.
>
> Given that Py3.5 is also going out of support in major Linux distributions
> within a year's time, I'd suggest we drop support for it in Cython 3.1,
> together with Py2 support, making the minimum version Py3.6. That would
> mean that we can start using f-strings, dict ordering, and what not.
>
> Any objections?
>
> Stefan

Blue

unread,
Aug 23, 2021, 4:43:28 PM8/23/21
to cython-users
Hello Stefan,

Regarding dropping Pyton 2 support in Cython 3.1 and bumping the minimum version to 3.6,
does this mean that there's a possibility that Cython itself could be annotated?

-------
Blue

D Woods

unread,
Aug 24, 2021, 4:34:20 PM8/24/21
to cython-users
> does this mean that there's a possibility that Cython itself could be annotated?

Currently Cython optionally compiles itself, using types given in .pxd files (and whatever it can infer, of course). The .pxd files a bit of a pain to maintain because they aren't close to the code and it's easy to forget they are there. It also sparsely uses @cython.declare-type compiler directives.

Annotations would be a nice way of adding typing information to Cython, but I don't think they add anything that we can't already do. Right now most of it isn't typed (just because it isn't numeric code, so doesn't really benefit) and that'd probably the case even with annotations.

I expect annotations will be slowly added to new/modified code whenever they're helpful for either speed or readability. Hopefully no-one will go through ExprNodes.py and annotate every variable in one enormous change. (But also I'm a bit biased against "complex" annotations at least - I can see the point of `typing.Optional`, but `typing.Union` is where I start to get sceptical).

Cython 3.1 is still a little way off of course.

David
Reply all
Reply to author
Forward
0 new messages