[Cython] Preparing Cython 3.0 with breaking changes

2018-08-18 Thread Stefan Behnel
Hi all,

following the versioning discussion, I created a milestone to collect
(breaking) changes that should go into the future Cython 3.0 release.

https://github.com/cython/cython/milestone/58

While a major version change is a good time to fix things that, in
retrospect, have led us too far in the wrong direction, we are not planning
to remove the support for existing code any time soon that relies on the
current semantics. For now, it looks like the major breaking changes will
be to directive defaults, which means that setting them explicitly to their
current configuration (e.g. in setup.py) should keep code working across
Cython releases.

Feedback welcome.

Stefan
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Jeroen Demeyer

On 2018-08-17 21:51, Robert Bradshaw wrote:

It'd be nice to change the default of cython.binding as well (breaking
change).


Ideally, after PEP 580 is accepted :-)

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Jeroen Demeyer

On 2018-08-17 11:44, Stefan Behnel wrote:

Hej, that gives us an alternative for the versioning switch. We could
release Cython 3.0 when we change the default language level (and require
users to select "language_level=2" for legacy code). Definitely a breaking
change that merits inceasing the major version, and 3.0 seems very suitable.


One annoying point with language_level=3 is that all string literals 
become unicode (like from __future__ import unicode_literals). Unlike 
the other changes that language_level=3 makes, this is a major breaking 
change on Python 2.


So I would very much prefer enabling everything that language_level=3 
does, but keeping strings of type "str" on Python 2. Maybe you could 
invent a new option for that, say "language_level=3str"?



Jeroen.

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Jeroen Demeyer

On 2018-08-17 11:44, Stefan Behnel wrote:

https://github.com/cython/cython/issues?q=is%3Aissue+is%3Aopen+label%3A%22Python+Semantics%22


Please add https://github.com/cython/cython/issues/1635
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Robert Bradshaw
On Sat, Aug 18, 2018 at 10:24 AM, Jeroen Demeyer  wrote:
> On 2018-08-17 11:44, Stefan Behnel wrote:
>>
>> Hej, that gives us an alternative for the versioning switch. We could
>> release Cython 3.0 when we change the default language level (and require
>> users to select "language_level=2" for legacy code). Definitely a breaking
>> change that merits inceasing the major version, and 3.0 seems very
>> suitable.
>
>
> One annoying point with language_level=3 is that all string literals become
> unicode (like from __future__ import unicode_literals). Unlike the other
> changes that language_level=3 makes, this is a major breaking change on
> Python 2.
>
> So I would very much prefer enabling everything that language_level=3 does,
> but keeping strings of type "str" on Python 2. Maybe you could invent a new
> option for that, say "language_level=3str"?

Do the existing c_string_type and c_string_encoding directives not
cover this usecase? I suppose what you're asking for is str being the
str of the runtime, even if language_level=3 is set.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Jeroen Demeyer

On 2018-08-18 10:52, Robert Bradshaw wrote:

Do the existing c_string_type and c_string_encoding directives not
cover this usecase?


Those seem to refer to C strings, I am talking about the Python type of 
string literals.



I suppose what you're asking for is str being the
str of the runtime, even if language_level=3 is set.


Basically I am asking for

type("foo") is str

both on Python 2 and Python 3.
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Stefan Behnel
Am 18. August 2018 12:06:15 MESZ schrieb Jeroen Demeyer:
>On 2018-08-18 10:52, Robert Bradshaw wrote:
>> Do the existing c_string_type and c_string_encoding directives not
>> cover this usecase?
>
>Those seem to refer to C strings, I am talking about the Python type of
>string literals.
>
>> I suppose what you're asking for is str being the
>> str of the runtime, even if language_level=3 is set.
>
>Basically I am asking for
>
>type("foo") is str
>
>both on Python 2 and Python 3.

That's another breaking change, and might suggest some other adaptations, e.g. 
for the type of f-strings. But it does sound like a reasonable request. And, 
fingers crossed, it won't be relevant forever.

Stefan

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Jeroen Demeyer

Basically I am asking for

type("foo") is str

both on Python 2 and Python 3.


That's another breaking change


I'm not following here... what I'm asking is how Cython behaves 
currently (with language_level=2).

___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel


Re: [Cython] Cython 0.29 – or 29.0 ?

2018-08-18 Thread Stefan Behnel
Am 18. August 2018 21:11:14 MESZ schrieb Jeroen Demeyer:
>>> Basically I am asking for
>>>
>>> type("foo") is str
>>>
>>> both on Python 2 and Python 3.
>>
>> That's another breaking change
>
>I'm not following here... what I'm asking is how Cython behaves 
>currently (with language_level=2).

But only for one specific feature. The combination of features that you want 
does not exist yet. And enabling it for language_level=3 would break existing 
Py3 code. Meaning, we'd need a new setting here to make this non-breaking, but 
in any case, we'd create a new language subset that code would have to be 
adapted to.

You removed the part where I said that I consider it a reasonable request, and 
I think this would help users to make a migration step towards Py3, while 
continuing to support Py2 as long as necessary. Should we make that a new 
directive rather than a language level? Like "py2_str=str"? That would allow 
its use together with language_level=3 already in the next release.

Stefan
___
cython-devel mailing list
cython-devel@python.org
https://mail.python.org/mailman/listinfo/cython-devel