为什么返回 `None` 而不是 tkinter.Entry 对象?

182*_*216 5 python tkinter python-3.2

我是 python 的新手,四处闲逛,我注意到了这一点:

from tkinter import *
def test1():
    root = Tk()
    txtTest1 = Entry(root).place(x=10, y=10)
    print(locals())
def test2():
    root = Tk()
    txtTest2 = Entry(root)
    txtTest2.place(x=10, y=10)#difference is this line
    print(locals())
test1()
test2()
Run Code Online (Sandbox Code Playgroud)

输出包括:

'txtTest1': None

'txtTest2': <tkinter.Entry object at 0x00EADD70>

为什么 test1 有一个None而不是<tkinter.Entry object at ...

我正在使用 python 3.2 和 PyScripter。

jte*_*ace 5

place的方法不Entry返回值。它就地作用于现有的 Entry 变量。