会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
alexsheng
Powered by
博客园
博客园
|
首页
|
新随笔
|
联系
|
订阅
|
管理
2018年5月16日
python 对象创建对象的实际顺序
摘要:
阅读全文
posted @ 2018-05-16 10:28 alexsheng
阅读(141)
评论(0)
推荐(0)
解析Python中的__getitem__专有方法
摘要: (1) __getitem__ 专用方法很简单。像普通的方法 clear,keys 和 values 一样,它只是重定向到字典,返回字典的值。但是怎么调用它呢?哦,你可以直接调用 __getitem__,但是在实际中你其实不会那样做:我在这里执行它只是要告诉你它是如何工作的。正确地使用 __geti
阅读全文
posted @ 2018-05-16 08:57 alexsheng
阅读(556)
评论(0)
推荐(0)
2018年5月15日
python 属性方法由谁调用
摘要: class test: def __init__(self): self.value=1 #普通字段属性 def show(self): print(self.value) #普通方法 @staticmethod def func(): #静态方法,可以由test.func(self)直接调用,但是
阅读全文
posted @ 2018-05-15 16:00 alexsheng
阅读(804)
评论(0)
推荐(0)
python属性方法
摘要: class Foo: def f1(self): return 123 def f2(self,value): print(value) per = property(fget=f1,fset=f2) #用属性调用 # @property #@property上面和下面的两个函数是一样的 # def
阅读全文
posted @ 2018-05-15 15:55 alexsheng
阅读(130)
评论(0)
推荐(0)
python多继承的调用
摘要: #-*- coding:utf-8 -*-class BaseRequests: def __init__(self): print("BaseRequests.ini")class RequestsHandler(BaseRequests): def __init__(self): print('
阅读全文
posted @ 2018-05-15 13:51 alexsheng
阅读(211)
评论(0)
推荐(0)