1、Global Variables
每个函数都要这么来一段
2、Variable Type Identifying
print(type(var)) #output: numpy
实际上:
type(var) = numpy(numpy(float), numpy(int), str, balabalba)
3、Function Return
def foo↑(a, b, c, d):
e = foo2(b, c, d); f = foo3(a, b, c, d); g, h = foo4(a, b, e, f)
#foo2 3 4 is some other functions
return e, f, g, h
你如果连e, f, g, h的类型确定都调了一上午,说明你python不熟练.jpg
4、Global Variables2
str = "goddamn"
def foo(a):
str = a
foo("fuck you")
print(str) #output:maybe goddamn, but sometimes fuck you这段能把global的input_characters.add(str)运行成功
尤其是编译器认为你一个赋值语句是想要定义一个变量时
5、或许这就是弱类型语言吧.jpg
我实在难以想象vscode的程序员是怎么往python上弄了intellisense的,虽然这个intellisense不是总是work...
6、C#天下第一