Code Monkey home page Code Monkey logo

Comments (9)

gertvdijk avatar gertvdijk commented on September 2, 2024 1

I believe it's the same case as #113 (comment).
And your type checker should warn you that your input type list[int] is unsupported.

from crc.

noonchen-ni avatar noonchen-ni commented on September 2, 2024 1

I am using the default setting of pylance in vscode, and here is my screenshot:
image

from crc.

noonchen-ni avatar noonchen-ni commented on September 2, 2024

I believe it's the same case as #113 (comment). And your type checker should warn you that your input type list[int] is unsupported.

Oh, I thought iterable of bytes in the doc is similar to iterable of ints...

Thanks for the explanation, is it possible to print a warning when user gives a list[int]? I actually debugged for a long time to notice crc module has such behavior.

from crc.

noonchen-ni avatar noonchen-ni commented on September 2, 2024

AFAIK, vscode doesn't show any warning when I pass a list[int] to checksum method.

from crc.

gertvdijk avatar gertvdijk commented on September 2, 2024

Just double checked it quickly: it does, both mypy and Pylance provide this error for you. Please check your type checker configuration.
image

Also, I think it should be

-calc = Calculator(Crc32.CRC32)
+calc = Calculator(Crc32.CRC32.value)

from crc.

noonchen-ni avatar noonchen-ni commented on September 2, 2024

Well, my concerns are solved, you can close this issue if you wish, Thanks!

from crc.

gertvdijk avatar gertvdijk commented on September 2, 2024

I am using the default setting of pylance in vscode, and here is my screenshot:

Looks like you have some broader issues with Pylance in your VS Code setup then. Check basic things like: correct Python interpreter set up in VS Code? Type something obviously wrong; does it warn you at all? E.g. print(1234 + "foo")

image

If I have an invalid Python interpreter selected it will be silent as in your screenshot.

image

from crc.

noonchen-ni avatar noonchen-ni commented on September 2, 2024

Guess you are right, pylance doesn't show any error even when the python interpreter is detected. Anyway, thanks for the info.

from crc.

Nicoretti avatar Nicoretti commented on September 2, 2024

@gertvdijk thanks for taking care of this. @noonchen-ni as discussed the issue will be closed.
For further details see also : #113 (comment)

from crc.

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.