#class

Struct vs. Class In Swift Explained – LearnAppMaking

Published at June 25, 2019 ·  1 min read

swift 同时有 struct 和 class 两种类型,在 Python 中只有 class,在 Golang 中只有 struct ,而swift 似乎是把两种语言一种类似的类型均融合了。相同之处是,struct 和 class 均可以定义属性和方法,均有 init 以进行状态的初始化。不同的是,class 可以继承,也可以定义 deinitialized 实现在 class 销毁时调用某个函数 Struct vs. Class In Swift Explained – LearnAppMaking...


What are some (concrete) use-cases for metaclasses?

Published at April 17, 2019 ·  1 min read

非常详细和完整的举例说明 metaclass 的用例。当需要重构,更改新增某些 class 属性时,另外一个则是注册,获取继承 metaclass 的 class 。 What are some (concrete) use-cases for metaclasses?...


What are metaclasses in Python?

Published at April 17, 2019 ·  1 min read

python 中的 metaclass 究竟是什么。metaclass 是 class 的 class,class 是 metaclass 的一个实例。在 Python 中 type 则是一个常见 metaclass What are metaclasses in Python?...


What is the difference between @staticmethod and @classmethod?

Published at March 29, 2019 ·  1 min read

staticmethod 和 classmethod 的用途及区别。staticmethod 更多的是将与 class 相关的 method 与其相绑定,防止污染整个模块的 namespace,同时也方便继承的类进行方法的重写。 classmethod 则需要显式的将 cls 作为第一个参数传进去。 What is the difference between @staticmethod and @classmethod?...


Tags

abcs accept acid activemq affinity algorithm allocation android array async aws b+tree b-tree backoff benchmark best-practices bfs big-o bigquery bind bitcount blog break broker bubble buffer cache cap cert cgroups channel citus class classmethod cluster concurrency config consumer container cookie cors crawler cronjob csrf ctr data-science data-structure database datadog dataflow datascience decorator defer dfs distributed django dns docker double-shipping drf ecosia elastic-search enumerate epoll extra facebook-pixel financial-report flask flutter forward-proxy freelance frp garbage-collector gc gcp generator get gil git golang goroutine graphql ha handbook haproxy hash hash-slot hashring hashtable hpa http http-auth http-proxy http_proxy https index innodb instagram intergration interview ios javascript jinja2 jobboard jwt k8s kafka kibana kqueue label lambda layer4 layer7 lean levels.io linked-list linux list listen loadbalancer logs long-tail lru marketing master matplotlib memory merge metaclass metaprogramming metrics metrics-server microservices mitm model mq myisam mysql namespace nat netflix network-extension nginx nodejs nomad nosql npm oodesign openssl optimization orm pandas parallelism parkinglot patroni permission pg pipeline pixelme post postgresql postresql prefetch_related prerender process proxy proxycommand put pvm python queue rabbitmq rbac react-native rebase redis redis-cluster replication resource rest restfulapi retargeting retry revenue reverse-proxy rocketmq saas scaleable search-engine security select seo serverless service session set shadosocks shadowsocks shard sharding shell shopify sigint signal sigterm slack slave slow-query sniper sns socket socks5 source-code spa sql sqlalchemy sqs ssh ssl ssl-pinning stack startup state stateful stateless staticmethod string struct swift switch syscall system-design systemctl tcp tcp-proxy thread tmpreaper token traefik trustkit tunning type typeform udp variable vc vpn vuejs web web-development where yarn zset 削峰 宽索引 异步 窄索引 解耦 跨域 跳板机


Archives

2019 (137)
0001 (1)