Comments (5)
I think you need to enable it with truthy-bool.
from pylint.
Added the discussion label because I feel that a type checker would have a easier time with this issue.
from pylint.
Indeed, mypy
already has this feature. I would lean towards delegating this to them 😄
from pylint.
Indeed, mypy already has this feature.
Does it? I'm usually linting my codebase with the most recent pylint and mypy versions and mypy didn't catch it in my case. If I typed the ok
variable as bool, then it would work:
ok:bool = is_ok() # <-- this is covered by mypy
but that's more typing than I usually do.
from pylint.
nice, that's fine enough for me. thanks @DanielNoord !
from pylint.
Related Issues (20)
- PyTest FixtureRequest
- Feature Request: Have multiple types for a naming-style HOT 2
- Support disabling possibly-used-before-assignment in-line for specific variables HOT 2
- `@overload` causes `missing-param-doc` despite parameter being documented HOT 1
- False positive unnecessary-negation for float comparison HOT 2
- Import error with Python 3.11 HOT 8
- Pylint is not smart enough when analyzes functions returning coroutine. HOT 5
- With Pylint 3.2.4 and Python 3.8 getting incorrect error W0101: Unreachable code (unreachable) HOT 5
- Incorrect complaint about the `_fields` attribute of instances of `typing.NamedTuple` HOT 2
- Unreachable code if exception is caught in decorator HOT 3
- no-value-for-parameter false positive with sqlalchemy.ext.hybrid.hybrid_method
- How to satisfy `unexpected-keyword-arg` in derived class override method that creates an instance via a super() method HOT 3
- `multiple-statements` no longer detected in a `finally:` block HOT 1
- remap FIXMEs as INFO HOT 1
- E1101: Module 'orjson' has no 'dumps' member (no-member) HOT 1
- Crash ``slice step cannot be zero`` HOT 4
- pylint doesn't continue searching for files under a directory that is not a package HOT 2
- `invalid-name` false positive on assignment to class attribute `tearDown` HOT 1
- `missing-function-docstring` when overriding methods of generic classes with undefined type parameters
- attribute-defined-outside-init while class has __setattr__() HOT 18
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pylint.