GithubHelp home page GithubHelp logo

Comments (7)

eLvErDe avatar eLvErDe commented on July 17, 2024

Confirmed on Python 3.6.6 (Debian Buster), I'm actually wondering if this syntax isn't python >= 3.7...

from astunparse.

eLvErDe avatar eLvErDe commented on July 17, 2024
--- astunparse-1.5.0.orig/tests/common.py
+++ astunparse-1.5.0/tests/common.py
@@ -288,7 +288,7 @@ class AstunparseCommonTestCase:
     def test_bytes(self):
         self.check_roundtrip("b'123'")

-    @unittest.skipIf(sys.version_info < (3, 6), "Not supported < 3.6")
+    @unittest.skipIf(sys.version_info < (3, 7), "Not supported < 3.7")
     def test_joined_str(self):
         self.check_roundtrip('f"{key}={value!s}"')
         self.check_roundtrip('f"{key}={value!r}"')

from astunparse.

mbdevpl avatar mbdevpl commented on July 17, 2024

The f-strings are certainly a 3.6 syntax.

That f'''{key:f'''4'''}={value!s}''' should be f'{key:f4}={value!s}'(or something like that) instead.

I think that error might be occurring because implementation of unparsing of f-strings in astunparse is very simplistic. I think I did the first f-string unparsing implementation for argunparse. Maybe it's still around, and in such case I guess I'm the culprit here ;) We all could use a proper f-string unparser...

But why does this test pass on Travis where python version is 3.6.3 and not on 3.6.5 or 3.6.6? I have no idea...

from astunparse.

sclarkson avatar sclarkson commented on July 17, 2024

I still get this (and one more f-string error) on Python 3.7.0

from astunparse.

simonpercivall avatar simonpercivall commented on July 17, 2024

This is now (should now) be fixed in v1.6.0. (Please reopen if I missed something.)

from astunparse.

eLvErDe avatar eLvErDe commented on July 17, 2024

Hello,

The patch still applies on 1.6.2 so I guess it is not fixed.
Btw, I have no idea how to re-open a GitHub ticket...

Regards,

from astunparse.

sclarkson avatar sclarkson commented on July 17, 2024

Retested and v1.6.2 tests still work on Python 3.7.2.

from astunparse.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.