
🦀 coder at @openai. Sometimes do freelance journalism: @Guardian, @Telegraph, @openDemocracy. Python core dev in my spare time 🐍. Studied 🎶 a while back.
- Tweets735
- Following966
- Followers642
- Likes6.3K
![warning[redundant-condition]: Condition is always truthy
--> .talk-demos/inline_12.py:8:8
|
8 | if choice:
| ^^^^^^ Inferred type is `Choice`
|
info: `Choice` instances are always truthy because `Choice` cannot be subclassed and does not define `__bool__` or `__len__`
--> .talk-demos/inline_12.py:3:7
|
3 | class Choice(Enum):
| ^^^^^^^^^^^^ `Choice` defined here
|
info: `Choice` cannot be subclassed because it is an `Enum` subclass and defines enum members
Found 1 diagnostic](https://pbs.twimg.com/media/HTAQryhWsAAAwSK.png?name=small&format=webp)
ALT warning[redundant-condition]: Condition is always truthy --> .talk-demos/inline_12.py:8:8 | 8 | if choice: | ^^^^^^ Inferred type is `Choice` | info: `Choice` instances are always truthy because `Choice` cannot be subclassed and does not define `__bool__` or `__len__` --> .talk-demos/inline_12.py:3:7 | 3 | class Choice(Enum): | ^^^^^^^^^^^^ `Choice` defined here | info: `Choice` cannot be subclassed because it is an `Enum` subclass and defines enum members Found 1 diagnostic
![warning[redundant-condition]: Function `condition` is always truthy
--> .talk-demos/inline_6.py:3:4
|
3 | if condition:
| ^^^^^^^^^ Did you mean to call this function?
4 | pass
5 | / else:
6 | | print("no dice")
| |____________________- This following branch is unreachable
|
help: Replace with `condition()`
Found 1 diagnostic](https://pbs.twimg.com/media/HTAOjchXoAAOvA4.png?name=small&format=webp)
ALT warning[redundant-condition]: Function `condition` is always truthy --> .talk-demos/inline_6.py:3:4 | 3 | if condition: | ^^^^^^^^^ Did you mean to call this function? 4 | pass 5 | / else: 6 | | print("no dice") | |____________________- This following branch is unreachable | help: Replace with `condition()` Found 1 diagnostic












