V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
geeti
V2EX  ›  Python

请教关于 python 的 abc

  •  
  •   geeti · 2016-06-12 09:25:49 +08:00 · 2590 次点击
    这是一个创建于 2874 天前的主题,其中的信息可能已经有所发展或是发生改变。
    用 abc 的 metaclass , abstractmethod 的意义是什么?
    如果不用 abc ,子类 override 基类有什么不妥么?
    2 条回复    2016-06-15 10:20:16 +08:00
    introom
        1
    introom  
       2016-06-12 13:42:43 +08:00 via Android
    abstractmethod 类似 java 中的 abstract, 类不能实例化。


    没啥不妥,问题是你先把文档或者源码看了,你似乎不懂 abc 是干什么的。

    Lib/abc.py 行数不多,扫一眼就明白了。
    ZoomQuiet
        2
    ZoomQuiet  
       2016-06-15 10:20:16 +08:00
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   4726 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 10:00 · PVG 18:00 · LAX 03:00 · JFK 06:00
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.