码迷,mamicode.com
首页 >  
搜索关键字:call    ( 9711个结果
14.11类的成员修饰符
成员修饰符类的所有成员分为:字段,方法  公有成员,在任何地方都能访问  私有成员,只有在类的内部才能访问私有成员和公有成员的定义不同:私有成员命名时,前两个字符是下划线。(特殊成员除外,例如:init、call等)私有成员和公有成员的访问限制不同:静态字段:公有静态字段:类可以访问,类内部可以访问;派生类中可以访问私有静态字段:仅类内部可以访问普通字段:  公有普通字段:对象可以访问;类内部可以
分类:其他好文   时间:2018-04-13 16:10:19    阅读次数:105
14.12.1类的特殊成员1
类的特殊成员1__call__方法#__call__方法classFoo:def__init__(self):print("init")def__call__(self,*args,**kwargs):print("call")obj=Foo()obj()#init#callFoo()()#init#call#对象()只执行__call__方法,非常特殊#__init__也是,创建对象就执行__i
分类:其他好文   时间:2018-04-13 15:10:55    阅读次数:170
14.12.4类的特殊成员4
类的特殊成员4metaclass#在Python中,一切事物都是对象。****#classfoo:#pass#obj=foo()#obj是foo的对象#foo类是type的对象#只要写类,默认都继承object类#类都是type类的对象classmyType(type):def__init__(self,*args,**kwargs):print("mytype")passdef__call__(
分类:其他好文   时间:2018-04-13 15:07:31    阅读次数:124
POJ - 1308 Is It A Tree?【并查集】
A tree is a well-known data structure that is either empty (null, void, nothing) or is a set of one or more nodes connected by directed edges between ...
分类:其他好文   时间:2018-04-13 13:29:01    阅读次数:195
Angularjs: call other scope which in iframe
Angularjs: call other scope which in iframe To access and communicate in two directions (parent to iFrame, iFrame to parent), in case they are both in ...
分类:Web程序   时间:2018-04-13 11:29:48    阅读次数:230
Flask系列(十)自定义Form组件
一、wtforms源码流程 1、实例化流程分析 # 源码流程 1. 执行type的 __call__ 方法,读取字段到静态字段 cls._unbound_fields 中; meta类读取到cls._wtforms_meta中 2. 执行构造方法 a. 循环cls._unbound_fields中的 ...
分类:其他好文   时间:2018-04-13 11:12:51    阅读次数:327
Python多线程学习(上)
最近在学习python多线程,写一下随笔就当复习了。另外强烈推荐大家看一下《Python核心编程》这本书,这本书里面可以帮你学习python进阶。 一。基本概念: 1.线程: 线程又称为轻量级进程,线程之间可以进行信息共享,线程可以看成是主进程或‘主线程’的迷你进程。 2.进程: 进程又称为重量级进 ...
分类:编程语言   时间:2018-04-12 22:28:30    阅读次数:220
【Django错误】OSError: raw write() returned invalid length 14 (should have been between 0 and 7)
错误环境 使用Django框架创建完models类的之后,用python manage.py migrate命令来生成数据库表的时候出错 错误代码 错误原因 与win10系统、版本有关系 可能是unicode字符的返回值问题 解决办法 可以使用pip install win_unicode_cons ...
分类:其他好文   时间:2018-04-12 20:55:01    阅读次数:207
dir() 和 __dict__ 的对比
""" dir([object]) -> list of strings If called without an argument, return the names in the current scope. Else, return an alphabetized list of names ...
分类:其他好文   时间:2018-04-12 15:24:01    阅读次数:155
python requests 高级用法 -- 包括SSL 证书错误的解决方案
Session Objects会话对象 Session对象在请求时允许你坚持一定的参数。此外,还坚持由Session实例的所有请求的cookie。 让我们坚持在请求时使用 会话也可以用于提供默认的数据的请求的方法。这是通过提供的数据会话对象的属性: 任何字典将被合并session级别的设置的值传递给 ...
分类:编程语言   时间:2018-04-12 13:43:44    阅读次数:230
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!