[New-bugs-announce] [issue41241] Unnecessary Type casting in 'if condition'

Wansoo Kim report at bugs.python.org
Wed Jul 8 10:25:35 EDT 2020


New submission from Wansoo Kim <rladhkstn8 at gmail.com>:

Hello!

When using 'if syntax', casting condition to bool type is unnecessary. Rather, it only occurs overhead.

https://github.com/python/cpython/blob/b26a0db8ea2de3a8a8e4b40e69fc8642c7d7cb68/Lib/asyncio/futures.py#L118

If you look at the link above, the `val` has been cast to bool type. This works well without bool casting.

This issue is my first issue. So if you have a problem, please tell me!

Thanks You!

----------
components: asyncio
messages: 373309
nosy: asvetlov, ys19991, yselivanov
priority: normal
severity: normal
status: open
title: Unnecessary Type casting in 'if condition'
type: enhancement
versions: Python 3.10

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue41241>
_______________________________________


More information about the New-bugs-announce mailing list