You might be surprised here if you are unfamiliar with the trick — Python does not have an "official" static scoping declaration.
这里,如果您不熟悉这个诀窍,可能会感到诧异—python没有“正式”的静态范围声明。
Notice too that the Listing 2 version could consist entirely of static methods. No Shared knowledge exists between the methods, so I have less need for encapsulation via scoping.
还要注意清单2版本可以完全由静态方法组成,因此就不太需要通过scoping来封装。
Notice too that the Listing 2 version could consist entirely of static methods. No Shared knowledge exists between the methods, so I have less need for encapsulation via scoping.
还要注意清单2版本可以完全由静态方法组成,因此就不太需要通过scoping来封装。
应用推荐