查询词典 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方式的默认做法是起码给你返回想如下格式的信息
- 推荐网络例句
-
I can do simple painting, carpentry and plumbing.
我能做简单的油漆、木工和修水管等工作。
-
The motivations, notations and outline of this work are also given in this chapter.
从这个意义上讲,这些时滞是无害的。然后用实例说明这三个定理的应用和互不包含性。
-
American writer known for his droll epigrammatic verse,much of which appeared in the New Yorker.
纳西,奥格登1902-1971美国作家,因写没有固定韵律的幽默诗而闻名,其中大多数发表在《纽约人》杂志上