[issue39581] Python Interpreter Doesn't Work Well In Thread Class

Mark Dickinson report at bugs.python.org
Sat Feb 8 05:14:31 EST 2020


Mark Dickinson <dickinsm at gmail.com> added the comment:

There's no other reasonable way for Python to work here. It *is* an error to pass something that's not a callable as a thread "target", but it's a coding error that can only be detected at runtime, not a syntax error that can be detected statically before the code executes.

And because threadFunc() never returns, Python never gets the opportunity to check the arguments to threading.Thread: the arguments to a function call have to be evaluated before that function call can be made.

It is a fairly common error, though, and it might be possible for a linter to flag this error (though probably with a smattering of false positives and false negatives). That's out of scope for Python itself.

----------
nosy: +mark.dickinson
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

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


More information about the Python-bugs-list mailing list