资源简介
图形化处理软件P4VASP
代码片段和文件信息
# 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 2011-10-14 05:05 p4vasp\
目录 0 2011-10-14 05:06 p4vasp\App\
目录 0 2011-10-14 05:06 p4vasp\App\DLLs\
文件 76800 2011-06-13 04:06 p4vasp\App\DLLs\bz2.pyd
文件 19790 2011-03-08 22:39 p4vasp\App\DLLs\py.ico
文件 19790 2011-03-08 22:39 p4vasp\App\DLLs\pyc.ico
文件 152576 2011-06-13 04:06 p4vasp\App\DLLs\pyexpat.pyd
文件 11776 2011-06-13 04:06 p4vasp\App\DLLs\select.pyd
文件 635392 2011-06-13 04:06 p4vasp\App\DLLs\sqlite3.dll
文件 867840 2010-08-29 03:42 p4vasp\App\DLLs\tcl85.dll
文件 8192 2010-08-29 03:42 p4vasp\App\DLLs\tclpip85.dll
文件 1320448 2010-08-29 03:45 p4vasp\App\DLLs\tk85.dll
文件 688128 2011-06-13 04:06 p4vasp\App\DLLs\unicodedata.pyd
文件 10752 2011-06-13 04:06 p4vasp\App\DLLs\winsound.pyd
文件 988672 2011-06-13 04:06 p4vasp\App\DLLs\_bsddb.pyd
文件 106496 2011-06-13 04:06 p4vasp\App\DLLs\_ctypes.pyd
文件 15360 2011-06-13 04:06 p4vasp\App\DLLs\_ctypes_test.pyd
文件 93696 2011-06-13 04:06 p4vasp\App\DLLs\_elementtree.pyd
文件 287232 2011-06-13 04:06 p4vasp\App\DLLs\_hashlib.pyd
文件 46592 2011-06-13 04:06 p4vasp\App\DLLs\_msi.pyd
文件 28672 2011-06-13 04:06 p4vasp\App\DLLs\_multiprocessing.pyd
文件 38400 2011-06-13 04:09 p4vasp\App\DLLs\_socket.pyd
文件 57344 2011-06-13 04:06 p4vasp\App\DLLs\_sqlite3.pyd
文件 720896 2011-06-13 04:09 p4vasp\App\DLLs\_ssl.pyd
文件 32256 2011-06-13 04:06 p4vasp\App\DLLs\_testcapi.pyd
文件 30208 2011-06-13 04:06 p4vasp\App\DLLs\_tkinter.pyd
目录 0 2011-10-14 05:06 p4vasp\App\Doc\
文件 5858915 2011-06-13 03:29 p4vasp\App\Doc\python272.chm
目录 0 2011-10-14 05:07 p4vasp\App\include\
文件 46411 2011-05-30 18:53 p4vasp\App\include\abstract.h
文件 1144 2011-03-08 22:43 p4vasp\App\include\asdl.h
............此处省略15776个文件信息
评论
共有 条评论