资源简介
python pypy
代码片段和文件信息
# 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:
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-06-07 14:18 pypy2-v5.8.0-win32\
目录 0 2017-06-07 14:18 pypy2-v5.8.0-win32\site-packages\
文件 119 2017-06-06 05:22 pypy2-v5.8.0-win32\site-packages\README
目录 0 2017-06-07 14:18 pypy2-v5.8.0-win32\include\
文件 748 2017-06-06 03:29 pypy2-v5.8.0-win32\include\code.h
文件 2215 2017-06-06 03:27 pypy2-v5.8.0-win32\include\PyPy.h
文件 2245 2017-06-06 03:29 pypy2-v5.8.0-win32\include\stringob
文件 3747 2017-06-06 03:29 pypy2-v5.8.0-win32\include\modsupport.h
文件 305 2017-06-06 03:29 pypy2-v5.8.0-win32\include\dictob
文件 1369 2017-06-06 03:29 pypy2-v5.8.0-win32\include\eval.h
文件 12 2017-06-06 03:29 pypy2-v5.8.0-win32\include\longintrepr.h
文件 6256 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pypy_macros.h
文件 1723 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pythonrun.h
文件 850 2017-06-06 03:29 pypy2-v5.8.0-win32\include\tupleob
文件 464 2017-06-06 03:29 pypy2-v5.8.0-win32\include\complexob
文件 3611 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pypy_numpy.h
文件 11012 2017-06-06 03:29 pypy2-v5.8.0-win32\include\ob
文件 3063 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pyport.h
文件 621 2017-06-06 03:29 pypy2-v5.8.0-win32\include\funcob
文件 2142 2017-06-06 03:29 pypy2-v5.8.0-win32\include\structmember.h
文件 442 2017-06-06 03:29 pypy2-v5.8.0-win32\include\longob
文件 940 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pythread.h
文件 1971 2017-06-06 03:29 pypy2-v5.8.0-win32\include\datetime.h
文件 1735 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pycapsule.h
文件 1685 2017-06-06 03:29 pypy2-v5.8.0-win32\include\pycob
文件 44 2017-06-06 03:29 pypy2-v5.8.0-win32\include\fileob
文件 345 2017-06-06 03:29 pypy2-v5.8.0-win32\include\traceback.h
文件 157 2017-06-06 03:29 pypy2-v5.8.0-win32\include\compile.h
文件 302 2017-06-06 03:29 pypy2-v5.8.0-win32\include\fr
文件 1022 2017-06-06 03:29 pypy2-v5.8.0-win32\include\abstract.h
文件 12 2017-06-06 03:29 pypy2-v5.8.0-win32\include\ceval.h
............此处省略3313个文件信息
相关资源
- python 2.7-64位_numpy+mkl
- Python编程快速上手 pdf+源码
- python项目-face++人脸识别考勤机-pytho
- 简单教务系统.7z
- 利用python数据分析第二版-中文版&英文
- Python-3.6.2.tgz
- python实现车牌识别
- Python-3.7.4.tgz
- Python语法入门thinkpython_cnpython_课件,
- Python27 x64.zip
- Python编程从入门到实践[中英文完整版
- Python机器学习经典 中文完整版高清
- python核心编程第三版(高清中文版)
- Python界面版学生管理系统
- python专利爬虫
- (一)python爬虫验证码识别去除干扰
- Python-西瓜视频百万英雄答题助手
- deep learning with python中文版232513
- python编程从入门到精通配套资源
- Data Wrangling with Python
- 笨方法学python3
- Python数据分析.mobi
- Hands-On Reinforcement Learning with Python 20
- wxPython3.0-win32-3.0.2.0-py27
- python知识点汇总 思维导图
- Python学习手册 第5版(Learning Python)
- 精通Python设计模式.pdf 详细目录,高清
- 经典教程Automate the Boring Stuff with Pyt
- Python和HDF5大数据应用
- 全套从零开始学Python网络爬虫教学以
评论
共有 条评论