On Fri, May 14, 2021 at 3:09 PM Ricky Teachey <ri...@teachey.org> wrote:
> On Fri, May 14, 2021 at 1:14 PM André Roberge <andre.robe...@gmail.com> > wrote: > >> >> 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 >> > > Thanks Andre I tried it out and it works great. > > Do the appended capital Fs make these numbers look like some kind of > hexadecimal representation or is it just me? > No, it was F for Fraction. Any integer followed by "F" will be transformed into a fraction.Fraction instance. You can also install decimal-literal as use D as a suffix. I had mentioned this in a previous message on this list (See https://www.mail-archive.com/python-ideas@python.org/msg24946.html) André > > --- > Ricky. > > "I've never met a Kentucky man who wasn't either thinking about going home > or actually going home." - Happy Chandler > > >
_______________________________________________ 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/HA6VRSSKUBCQF57ULEY27SFPDO3WU4TY/ Code of Conduct: http://python.org/psf/codeofconduct/