From jbrockmendel at gmail.com Wed Oct 13 22:07:51 2021 From: jbrockmendel at gmail.com (Brock Mendel) Date: Wed, 13 Oct 2021 19:07:51 -0700 Subject: [Cython] pandas discussion 0.29.x vs 3.0.a.x Message-ID: On the pandas dev call this morning we discussed whether to bump the cython version we are using from 0.29.x to the most recent 3.0 alpha. The main _new_ point that was made was that we should stick to versions that are available on conda-forge. The latest there is 0.29.24. Aside from that, I'll be doing a build locally to see if we _can_ use 3.0a9 and we'll revisit the question at next month's meeting. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dw-git at d-woods.co.uk Mon Oct 25 14:57:25 2021 From: dw-git at d-woods.co.uk (da-woods) Date: Mon, 25 Oct 2021 19:57:25 +0100 Subject: [Cython] Annotations and Cython 3 In-Reply-To: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> References: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> Message-ID: <5d5450f2-3db1-8cd3-58d3-d19bdde2b903@d-woods.co.uk> One further option would be to revert to Cython 0.29 behaviour, but support the PEP-563 version as a "from __future__" import (essentially following the current behaviour of Python). When I wrong the original patch for the PEP-563 I tried to do that, but then removed the code in favour of keeping one simpler option. But the code to do this mostly already exists (somewhere) On 25/10/2021 19:11, da-woods wrote: > [...] From dw-git at d-woods.co.uk Mon Oct 25 14:11:10 2021 From: dw-git at d-woods.co.uk (da-woods) Date: Mon, 25 Oct 2021 19:11:10 +0100 Subject: [Cython] Annotations and Cython 3 Message-ID: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> I suspect the answer to this is still "wait and see" but: do we have an opinion on what we want to do about annotations in Cython 3. Currently we're targetting PEP-563 behaviour. To me it looks fairly likely that this won't be what Python decides on. I guess the likely outcomes are "status quo" or something close to PEP-649. The issue with the PEP-563 (stringify everything) behaviour is that it's noticeably different, so releasing Cython 3 with that behaviour then changing to something else will be an obvious incompatible change. I'd be reluctant to implement PEP-649 until it's actually accepted (it looks hard...). Is it worth reverting to the Cython 0.29 behaviour (with some scoping fixes) on the basis that it's what most people are using now, and it's likely to be closer what what's picked? Or should we at least mark "decide what to do with annotations" as a blocker for Cython 3? David From dalcinl at gmail.com Tue Oct 26 01:54:10 2021 From: dalcinl at gmail.com (Lisandro Dalcin) Date: Tue, 26 Oct 2021 08:54:10 +0300 Subject: [Cython] Annotations and Cython 3 In-Reply-To: <5d5450f2-3db1-8cd3-58d3-d19bdde2b903@d-woods.co.uk> References: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> <5d5450f2-3db1-8cd3-58d3-d19bdde2b903@d-woods.co.uk> Message-ID: On Mon, 25 Oct 2021 at 21:57, da-woods wrote: > One further option would be to revert to Cython 0.29 behaviour, but > support the PEP-563 version as a "from __future__" import (essentially > following the current behaviour of Python). In any case, if you know how and can implement the __future__ import, that would be great. Otherwise, valid Python3 code using that import currently fails to compile in Cython. In addition, perhaps you should consider adding a compiler directive (or there is one already that I'm missing?) that we can pass with -X o type as a #cython comment in sources. In the face of ambiguity... give users various alternatives to the control the behavior. -- Lisandro Dalcin ============ Senior Research Scientist Extreme Computing Research Center (ECRC) King Abdullah University of Science and Technology (KAUST) http://ecrc.kaust.edu.sa/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From stefan_ml at behnel.de Tue Oct 26 02:53:31 2021 From: stefan_ml at behnel.de (Stefan Behnel) Date: Tue, 26 Oct 2021 08:53:31 +0200 Subject: [Cython] Annotations and Cython 3 In-Reply-To: References: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> <5d5450f2-3db1-8cd3-58d3-d19bdde2b903@d-woods.co.uk> Message-ID: <94828A2C-012A-4801-B021-02ECC249E125@behnel.de> Am 26. Oktober 2021 07:54:10 MESZ schrieb Lisandro Dalcin: >In any case, if you know how and can implement the __future__ import, >that >would be great. Otherwise, valid Python3 code using that import >currently fails to compile in Cython. Probably just an oversight. A no-op future import is trivial to add and ignore. >In addition, perhaps you should consider adding a compiler directive There is one (annotation_typing) that controls whether Cython reads annotations as types or not (which isn't what you're asking for). Apart from that, since there is no future unimport, there should probably be a way to get either behaviour, regardless of the default. Stefan From dw-git at d-woods.co.uk Tue Oct 26 03:14:06 2021 From: dw-git at d-woods.co.uk (da-woods) Date: Tue, 26 Oct 2021 08:14:06 +0100 Subject: [Cython] Annotations and Cython 3 In-Reply-To: <94828A2C-012A-4801-B021-02ECC249E125@behnel.de> References: <89a66388-7ea7-c510-320f-45879d8b0b6d@d-woods.co.uk> <5d5450f2-3db1-8cd3-58d3-d19bdde2b903@d-woods.co.uk> <94828A2C-012A-4801-B021-02ECC249E125@behnel.de> Message-ID: On 26/10/2021 07:53, Stefan Behnel wrote: > Am 26. Oktober 2021 07:54:10 MESZ schrieb Lisandro Dalcin: >> In any case, if you know how and can implement the __future__ import, >> that >> would be great. Otherwise, valid Python3 code using that import >> currently fails to compile in Cython. > Probably just an oversight. A no-op future import is trivial to add and ignore. We do support the __future__ import as a no-op on the Cython 3 alphas: https://github.com/cython/cython/blob/e93c2c556c5c15148763b26c6e3eef35ee88a22f/tests/run/pep563_annotations.py#L4