資源簡介
python2.7 64位,windows下的安裝包,免安裝,親測有效
代碼片段和文件信息
#?Copyright?2007?Google?Inc.?All?Rights?Reserved.
#?Licensed?to?PSF?under?a?Contributor?Agreement.
“““Abstract?base?Classes?(ABCs)?according?to?PEP?3119.“““
import?types
from?_weakrefset?import?WeakSet
#?Instance?of?old-style?class
class?_C:?pass
_InstanceType?=?type(_C())
def?abstractmethod(funcobj):
????“““A?decorator?indicating?abstract?methods.
????Requires?that?the?metaclass?is?ABCmeta?or?derived?from?it.??A
????class?that?has?a?metaclass?derived?from?ABCmeta?cannot?be
????instantiated?unless?all?of?its?abstract?methods?are?overridden.
????The?abstract?methods?can?be?called?using?any?of?the?normal
????‘super‘?call?mechanisms.
????Usage:
????????class?C:
????????????__metaclass__?=?ABCmeta
????????????@abstractmethod
????????????def?my_abstract_method(self?...):
????????????????...
????“““
????funcobj.__isabstractmethod__?=?True
????return?funcobj
class?abstractproperty(property):
????“““A?decorator?indicating?abstract?properties.
????Requires?that?the?metaclass?is?ABCmeta?or?derived?from?it.??A
????class?that?has?a?metaclass?derived?from?ABCmeta?cannot?be
????instantiated?unless?all?of?its?abstract?properties?are?overridden.
????The?abstract?properties?can?be?called?using?any?of?the?normal
????‘super‘?call?mechanisms.
????Usage:
????????class?C:
????????????__metaclass__?=?ABCmeta
????????????@abstractproperty
????????????def?my_abstract_property(self):
????????????????...
????This?defines?a?read-only?property;?you?can?also?define?a?read-write
????abstract?property?using?the?‘long‘?form?of?property?declaration:
????????class?C:
????????????__metaclass__?=?ABCmeta
????????????def?getx(self):?...
????????????def?setx(self?value):?...
????????????x?=?abstractproperty(getx?setx)
????“““
????__isabstractmethod__?=?True
class?ABCmeta(type):
????“““metaclass?for?defining?Abstract?base?Classes?(ABCs).
????Use?this?metaclass?to?create?an?ABC.??An?ABC?can?be?subclassed
????directly?and?then?acts?as?a?mix-in?class.??You?can?also?register
????unrelated?concrete?classes?(even?built-in?classes)?and?unrelated
????ABCs?as?‘virtual?subclasses‘?--?these?and?their?descendants?will
????be?considered?subclasses?of?the?registering?ABC?by?the?built-in
????issubclass()?function?but?the?registering?ABC?won‘t?show?up?in
????their?MRO?(Method?Resolution?Order)?nor?will?method
????implementations?defined?by?the?registering?ABC?be?callable?(not
????even?via?super()).
????“““
????#?A?global?counter?that?is?incremented?each?time?a?class?is
????#?registered?as?a?virtual?subclass?of?anything.??It?forces?the
????#?negative?cache?to?be?cleared?before?its?next?use.
????_abc_invalidation_counter?=?0
????def?__new__(mcls?name?bases?namespace):
????????cls?=?super(ABCmeta?mcls).__new__(mcls?name?bases?namespace)
????????#?Compute?set?of?abstract?method?names
????????abstracts?=?set(name
?????????????????????for?name?value?in?namespace.items()
????????????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-06?14:10??Python27?x64\
?????目錄???????????0??2017-11-01?14:26??Python27?x64\DLLs\
?????文件???????92672??2017-09-16?20:27??Python27?x64\DLLs\bz2.pyd
?????文件???????19790??2017-02-13?22:38??Python27?x64\DLLs\py.ico
?????文件???????19790??2017-02-13?22:38??Python27?x64\DLLs\pyc.ico
?????文件??????186368??2017-09-16?20:27??Python27?x64\DLLs\pyexpat.pyd
?????文件???????11776??2017-09-16?20:27??Python27?x64\DLLs\select.pyd
?????文件??????785408??2017-09-16?20:28??Python27?x64\DLLs\sqlite3.dll
?????文件?????1205248??2017-02-13?23:09??Python27?x64\DLLs\tcl85.dll
?????文件????????9728??2017-02-13?23:09??Python27?x64\DLLs\tclpip85.dll
?????文件?????1773056??2017-02-13?23:10??Python27?x64\DLLs\tk85.dll
?????文件??????692224??2017-09-16?20:27??Python27?x64\DLLs\unicodedata.pyd
?????文件???????12288??2017-09-16?20:27??Python27?x64\DLLs\winsound.pyd
?????文件?????1470976??2017-09-16?20:30??Python27?x64\DLLs\_bsddb.pyd
?????文件??????120832??2017-09-16?20:27??Python27?x64\DLLs\_ctypes.pyd
?????文件???????16384??2017-09-16?20:27??Python27?x64\DLLs\_ctypes_test.pyd
?????文件??????187904??2017-09-16?20:27??Python27?x64\DLLs\_elementtree.pyd
?????文件?????1483264??2017-09-16?20:29??Python27?x64\DLLs\_hashlib.pyd
?????文件???????23552??2017-09-16?20:27??Python27?x64\DLLs\_msi.pyd
?????文件???????34816??2017-09-16?20:27??Python27?x64\DLLs\_multiprocessing.pyd
?????文件???????50688??2017-09-16?20:28??Python27?x64\DLLs\_socket.pyd
?????文件???????64000??2017-09-16?20:28??Python27?x64\DLLs\_sqlite3.pyd
?????文件?????2101760??2017-09-16?20:28??Python27?x64\DLLs\_ssl.pyd
?????文件???????52224??2017-09-16?20:27??Python27?x64\DLLs\_testcapi.pyd
?????文件???????51712??2017-09-16?20:29??Python27?x64\DLLs\_tkinter.pyd
?????目錄???????????0??2017-11-01?14:26??Python27?x64\Doc\
?????文件?????6251855??2017-09-16?20:18??Python27?x64\Doc\python2714.chm
?????目錄???????????0??2017-11-01?14:26??Python27?x64\include\
?????文件???????46621??2017-02-13?22:37??Python27?x64\include\abstract.h
?????文件????????1144??2017-02-13?22:37??Python27?x64\include\asdl.h
?????文件?????????243??2017-02-13?22:37??Python27?x64\include\ast.h
............此處省略4164個文件信息
評論
共有 條評論