trotyl's recent timeline updates
trotyl

trotyl

🏢  ThoughtWorks / Developer
V2EX member #107772, joined on 2015-03-27 23:14:56 +08:00
32 S 31 B
trotyl's recent replies
Mar 12, 2016
Replied to a topic by dsp2138 Python POST 请求这样构建对不对?为啥总不成功
你的 postdata 根本就没用过。。不懂你是要干什么。。
Mar 7, 2016
Replied to a topic by codespots JavaScript JavaScript 算法初探——数组去重
@westooy 说的好像 indexOf 不是循环一样。。
Oct 8, 2015
Replied to a topic by hujianxin 程序员 一个关于类的编程基础问题!
要用面向对象的话,举个栗子,比如:
class Translator:
def __init__(self):
pass
def identify_language(self, source):
pass
def translate(self, source, destination_language='Chinise'):
pass

class BaiduTranslator(Translator):
...

class YoudaoTranslator(Translator):
...

按照传统面向对象差不多就是这样用一个基类或者接口,然后可以继承为不同的子类,子类才是用来实例化的,并且有对应方法的具体实现。。

但其实 Python 因为是动态类型应该也可以直接 Duck Typing 的。。

仅供参考。。-_-#
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1059 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 13ms · UTC 22:43 · PVG 06:43 · LAX 15:43 · JFK 18:43
♥ Do have faith in what you're doing.