On Fri, May 14, 2021 at 12:40 PM Martin Teichmann <
martin.teichm...@gmail.com> wrote:

> Hi Paul,
>
> I would be fine with a new division operator or fraction literal as well,
> and in the beginning this is what I actually wanted to propose.
>

You can already experiment with this.


First, install a few packages

python -m pip install ideas  # will also install token-utils
python -m pip install fraction-literal


Next, start your standard Python interpreter and do the following:

>>> from ideas import experimental_syntax_encoding
>>> from ideas import console
>>> console.start()
Configuration values for the console:
    transform_source: <function transform_source at 0x00E61FA8>
--------------------------------------------------
Ideas Console version 0.0.19. [Python version: 3.7.8]

~>> from experimental-syntax import fraction_literal
~>> 2/3F
Fraction(2, 3)
~>>

Appending an "F" after integer fractions literal is all that is needed.

André Roberge



>
> But then I started prototyping, and given that it is not so easy to change
> the parser, I just changed the normal division operator. And interestingly,
> nearly nothing broke.
>
> The biggest compatibility problem I actually experienced was the
> completely unrelated breaking of PyCode_New in recent commits of CPython,
> which made using cython and thus numpy impossible. That was so hard to
> tackle I actually gave up and simply branched of an older version of
> CPython. What I want to say with that is: we are happily breaking
> compatibility for more minor stuff. I think my proposal would be a major
> improvement, which would warrant breaking of compatiblity, especially
> because this break of compatibility is astonishingly small. As said above,
> I already installed unmodified numpy, sympy, cython and all their tool
> chains.
>
> Cheers
>
> Martin
> _______________________________________________
> Python-ideas mailing list -- python-ideas@python.org
> To unsubscribe send an email to python-ideas-le...@python.org
> https://mail.python.org/mailman3/lists/python-ideas.python.org/
> Message archived at
> https://mail.python.org/archives/list/python-ideas@python.org/message/ZAB5CTTFQ2FOUZQOCYCZZ7EEDJ3P2SPR/
> Code of Conduct: http://python.org/psf/codeofconduct/
>
_______________________________________________
Python-ideas mailing list -- python-ideas@python.org
To unsubscribe send an email to python-ideas-le...@python.org
https://mail.python.org/mailman3/lists/python-ideas.python.org/
Message archived at 
https://mail.python.org/archives/list/python-ideas@python.org/message/SEGXOKXCIGFU636JZEDI53NATUP65FJG/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to