[New-bugs-announce] [issue39581] Python Interpreter Doesn't Work Well In Thread Class

임수진학부생 report at bugs.python.org
Sat Feb 8 04:55:36 EST 2020

New submission from 임수진학부생 <21600590 at handong.edu>:

import threading
import time

def threadFunc():
    while True:
        print('new thread')
def main():
    th = threading.Thread(target=threadFunc())
    while True:
       print('main Thread')
if __name__ == '__main__':

When I run the above code in python 3.7, it works in unexpected way.

I expected this code causes an syntax error for giving an improper argument to parameter because I gave "threaFunc()" not "threaFun" as an argument of target in Thread class. However, this code executes a function "threadFunc()" as a general function not thread.

components: Windows
messages: 361622
nosy: paul.moore, steve.dower, tim.golden, zach.ware, 임수진학부생
priority: normal
severity: normal
status: open
title: Python Interpreter Doesn't Work Well In Thread Class
type: behavior
versions: Python 3.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list