Daily 9/13

学习

Python

super

理解 Python super 不要一说到 super 就想到父类!super 指的是 MRO 中的下一个类!

class Root(object):
    def __init__(self):
        print("this is Root")

class B(Root):
    def __init__(self):
        print("enter B")
        # print(self)  # this will print <__main__.D object at 0x...>
        super(B, self).__init__()
        print("leave B")

class C(Root):
    def __init__(self):
        print("enter C")
        super(C, self).__init__()
        print("leave C")

class D(B, C):
    pass

d = D()
print(d.__class__.__mro__)

mixin

Python mixin模式 Python的Mixin模式可以通过多继承的方式来实现

Vim

let g:UltiSnipsExpandTrigger="<c-j>"

ultisnips 自动完成跟YCM的<tab>快捷键冲突
UltiSnips 让 Vim 飞起来 vim snippets详细设置过程

Andoid

Compile gradle project with another project as a dependency 编译两个独立的项目,需要制定依赖的路径
Dependency Management Gradle依赖

最后修改 February 7, 2021 : doc: 整理daily日记 (0dcc57d)