# check that consts are not replaced in anything except standalone identifiersfrom micropython import constX = const(1)Y = const(2)Z = const(3)# import that uses a constantimport micropython as Xprint(globals()['X'])# function name that matches a constantdef X():print('function X', X)globals()['X']()# arguments that match a constantdef f(X, *Y, **Z):passf(1)# class name that matches a constantclass X:def f(self):print('class X', X)globals()['X']().f()# constant within a classclass A:C1 = const(4)def X(self):print('method X', Y, C1, self.C1)A().X()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。