正在加载图片...
Assigning Attributes Python Tutor link We saw this before,but let's formalize the rules for assigning/re- assigning instance and class attributes. <expression>.<name>=<value> Change attributes for the object of that dot expression. If the expression evaluates to an instance:then assignment sets an instance attribute,even if it exists in the class. If the expression evaluates to a class:then assignment sets a class attributeAssigning Attributes We saw this before, but let’s formalize the rules for assigning/re￾assigning instance and class attributes. <expression>.<name> = <value> Change attributes for the object of that dot expression. If the expression evaluates to an instance: then assignment sets an instance attribute, even if it exists in the class. If the expression evaluates to a class: then assignment sets a class attribute Python Tutor link
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有