This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author 임수진학부생
Recipients paul.moore, steve.dower, tim.golden, zach.ware, 임수진학부생
Date 2020-02-08.09:55:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581155736.57.0.784199472147.issue39581@roundup.psfhosted.org>
In-reply-to
Content
================================================================
import threading
import time

def threadFunc():
    while True:
        print('new thread')
        time.sleep(2)
def main():
    th = threading.Thread(target=threadFunc())
    th.start()
    while True:
       print('main Thread')
       time.sleep(1)
    th.join()
 
if __name__ == '__main__':
   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.
History
Date User Action Args
2020-02-08 09:55:36임수진학부생setrecipients: + 임수진학부생, paul.moore, tim.golden, zach.ware, steve.dower
2020-02-08 09:55:36임수진학부생setmessageid: <1581155736.57.0.784199472147.issue39581@roundup.psfhosted.org>
2020-02-08 09:55:36임수진학부생linkissue39581 messages
2020-02-08 09:55:36임수진학부생create