Git Product home page Git Product logo

Comments (3)

zsol avatar zsol commented on August 18, 2024 1

Yeah looks like no_string_type_annotation guards against typing_extension.Literal but not typing.Literal:

n.name == "typing_extensions.Literal" for n in qualnames

But also the rule should probably not crash when parse_expression raises an exception

from fixit.

thatch avatar thatch commented on August 18, 2024

The relevant part of that traceback is

  File "/home/pierre/pylint/venv/lib/python3.10/site-packages/fixit/rules/no_string_type_annotation.py", line 303, in visit_SimpleString

    replacement=cst.parse_expression(node.evaluated_value),

I'm guessing (based on which types have the string "class in them) that this is from https://github.com/pylint-dev/pylint/blob/fc97635b9515b650be2ce0e75a36e47a45094ccf/pylint/checkers/base/docstring_checker.py#L154

Don't know if this is a bug in no_string_type_annotation or not, but HTH

from fixit.

Pierre-Sassoulas avatar Pierre-Sassoulas commented on August 18, 2024

Fixit suggest to remove the quote around strings in typing.Litteral in another check (this is definitely a bug as the litteral string is not defined). Maybe a wrong assumption is being made here too ?

from fixit.

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.