93 特殊屬性

2021-10-09 15:01:48 字數 1832 閱讀 4912

python - 特殊屬性 - 文件

python物件中包含了很多雙下劃線開始和結束的屬性,這些是特殊屬性,有特殊用法。這 裡我們列出常見的特殊屬性:

# ipython 執行效果

in [12]

: c=c(3)

in [13]

: cout[13]

:<__main__.c at>

>

in [14]

:dir

(c)out[14]

:['__class__'

,'__delattr__'

,'__dict__'

,'__dir__'

,'__doc__'

,'__eq__'

,'__format__'

,'__ge__'

,'__getattribute__'

,'__gt__'

,'__hash__'

,'__init__'

,'__init_subclass__'

,'__le__'

,'__lt__'

,'__module__'

,'__ne__'

,'__new__'

,'__reduce__'

,'__reduce_ex__'

,'__repr__'

,'__setattr__'

,'__sizeof__'

,'__str__'

,'__subclasshook__'

,'__weakref__'

,'cc'

,'nn'

]in [15]

: c.__dict__

out[15]

:in [16]

: c.__class__

out[16]

: __main__.c

in [18]

: c.__bases__

out[18]

:(__main__.b, __main__.a)

in [19]

: c.mro(

)out[19]

:[__main__.c, __main__.b, __main__.a,

object

]in [21]

: a.__subclasses__

out[21]

:in [22]

: a.__subclasses__(

)out[22]

:[__main__.c]

vue 特殊屬性

長用於構建動態元件且基於 dom 內模板的限制 插槽,推薦使用2.6.0新出的v slot 用於標記往哪個具名插槽中插入子元件內容。被 2.5.0 新增的 slot scope 取代。推薦 2.6.0 新增的 v slot 用於表示乙個作為帶作用域的插槽的 元素,它在 2.5.0 中被 slot s...

Linux檔案特殊屬性

文中有不對或者有不清楚的地方,請大家告訴我,謝謝!linux檔案特殊屬性 linux檔案特殊屬性主要包括它的預設許可權 隱藏屬性和特殊許可權 suid sgid sbit 下面我們就來分別講解它的這些特殊屬性。1.linux檔案預設許可權 umask 我們在新建立乙個檔案時,它都有自己的預設屬性。它...

特殊屬性之 ref

ref被用來給元素或子元件註冊引用資訊 引用資訊將註冊在父元件的 refs物件上 如果在dom元素上使用,引用指向的就是dom元素 如果在子元件上使用,引用指向的就是元件例項 ref p hellop ref child child component 當v for用於元素或元件時,引用資訊將是包含...