英语人>网络例句>pythonic 相关的网络例句
pythonic相关的网络例句

查询词典 pythonic

与 pythonic 相关的网络例句 [注:此内容来源于网络,仅供参考]

Pythonic programming style that determines an object's type by inspection of its method or attribute signature rather than by explicit relationship to some type object "If it looks like a duck and quacks like a duck, it must be a duck."

Pythonic编程风格,通过观查一个对象的方法或属性特征,而不是一个对象和某种类型的显式关系来决定一个对象的类型("如果一个东西像鸭子一样走路,像鸭子一样叫,那么它一定就是鸭子。")。

Practically all Python objects have a string presentation either evaluatable from repr( or '', or printable from str. The print statement automatically invokes the str function for an object. This gets even better. When you are defining your own objects, there are hooks for you to create string representations of your object such that repr and str (and '' and print) return an appropriate string as output. And if worse comes to worst and neither repr or str is able to display an object, the Pythonic default is at least to give you something of the format

事实上,所有的Python对象都有一个字符串表示形式(通过repr函数,''或者str函数来展现)。print语句自动为每个对象调用该对象的str方法,这种机制的一个额外的好处就是在你定义你自己的对象时,你可以利用这种机制定义repr(,str或者''或者print来为你的对象创建一种字符串表达形式,它可以在被调用时返回适当的字符串描述信息,这样即使在坏的不能再坏的情况下,repr或者str起码可以给你返回一个对象的信息,Pythonic方式的默认做法是起码给你返回想如下格式的信息

第3/3页 首页 < 1 2 3
推荐网络例句

Many will continue to choose to live in duality and in conflict.

许多人将继续选择活在二元对立性和冲突中。

I find that students of the University of Physical Education all wear sportswear at first sight.

我发现:体育大学的学生乍一看,都是穿运动衣,大家都一样

I love singing, but I don't want to take it as my lifelong career.

我喜欢唱歌,但我还不愿意把它当作我的终身职业。