資源簡介
notepad++的pythonscript插件

代碼片段和文件信息
#?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()
?????????????????????if?getattr(value?“__isabstractmethod__“?False))
????????for?base?in?bases:
????
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????242139??2011-02-27?03:00??plugins\doc\Pythonsc
?????文件??????914432??2011-02-27?03:00??plugins\Pythonsc
?????文件????????7145??2010-12-12?00:07??plugins\Pythonsc
?????文件???????33246??2009-10-15?01:30??plugins\Pythonsc
?????文件??????????60??2008-10-15?19:49??plugins\Pythonsc
?????文件????????2620??2002-06-01?22:18??plugins\Pythonsc
?????文件???????87304??2010-12-12?00:07??plugins\Pythonsc
?????文件???????11840??2009-01-13?19:52??plugins\Pythonsc
?????文件???????11402??2008-09-09?08:49??plugins\Pythonsc
?????文件???????20612??2010-12-12?00:07??plugins\Pythonsc
?????文件????????1705??2006-11-17?00:50??plugins\Pythonsc
?????文件????????7597??2008-05-07?07:23??plugins\Pythonsc
?????文件???????11357??2010-12-12?00:07??plugins\Pythonsc
?????文件???????22344??2010-02-22?18:55??plugins\Pythonsc
?????文件????????5744??2008-05-10?10:27??plugins\Pythonsc
?????文件???????20967??2010-12-12?00:07??plugins\Pythonsc
?????文件???????14476??2010-05-06?03:09??plugins\Pythonsc
?????文件????????2595??2009-04-01?01:47??plugins\Pythonsc
?????文件????????2730??2008-07-23?19:38??plugins\Pythonsc
?????文件???????11344??2010-03-22?22:22??plugins\Pythonsc
?????文件????????5308??2006-06-11?16:35??plugins\Pythonsc
?????文件???????12204??2010-03-22?22:22??plugins\Pythonsc
?????文件???????30879??2010-11-07?19:12??plugins\Pythonsc
?????文件????????2964??2009-10-15?02:01??plugins\Pythonsc
?????文件???????15988??2010-04-04?00:06??plugins\Pythonsc
?????文件??????212480??2011-02-06?23:58??plugins\Pythonsc
?????文件???????23107??2010-12-12?00:07??plugins\Pythonsc
?????文件???????34478??2010-12-12?00:07??plugins\Pythonsc
?????文件???????12986??2010-12-12?00:07??plugins\Pythonsc
?????文件???????12073??2010-04-02?02:17??plugins\Pythonsc
?????文件????????5372??2006-02-19?05:10??plugins\Pythonsc
............此處省略626個文件信息
- 上一篇:pycharm pymssql python3.6
- 下一篇:鏈路預測 python
評論
共有 條評論