Content deleted Content added
MalnadachBot (talk | contribs) m Fixed Lint errors in signatures. (Task 2) |
m Replaced deprecated <source> tags with <syntaxhighlight> (via WP:JWB) |
||
(One intermediate revision by one other user not shown) | |||
Line 134:
The point wasn't that it was awesome python code, rather that it mocks a code example from Ruby's website with their silly perl-esq sigils and magical behavior.
<
# Python knows what you mean, even if you want to do math on an entire set
cities = set(("""London
Line 146:
print ( "I still need to visit the following cities: "
+ ", ".join(cities - visited) )
</syntaxhighlight>
<
# Ruby knows what you
# mean, even if you
Line 163:
"following cities:",
cities - visited
</syntaxhighlight>
Granted the python example would look nicer with the set literal syntax a la 3.0.
Line 219:
:There are features of Python (or of most languages) that were not present in the first release. In the Java case, I think the usual example given is the use of Python decorators, which borrow a syntax element from Java. I'm not really convinced that that is enough to merit mentioning Java in the infobox. However, it is sophistical to suppose that influence must only follow the release dates of version 1.0 of every language... many languages influence each other on an ongoing basis, across multiple versions. [[User:Lulu of the Lotus-Eaters|<span style="color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk</span>]] 18:08, 23 November 2009 (UTC)
::Personally, the best example I know of is the <code>logging</code> module, which is very much a clone of the equivalent Java library. --[[User:Cybercobra|<b
:::That's true. And actually, the unit test module is also based on Java's. And probably another thing or two. And Guido used Java as a the model for Unicode, especially in 3.x. So I guess I don't really object to the inclusion of Java as an influence in the infobox. [[User:Lulu of the Lotus-Eaters|<span style="color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk</span>]] 19:39, 23 November 2009 (UTC)
Line 241:
Boolean operators and Boolean built-in types always return one of the Boolean values True and False ''except'' for the operators "<code>or</code>" and "<code>and</code>" which return one of their operands (from left to right, the first operand that determines the Boolean value of the expression).<ref>{{cite web| title=Boolean operations | url=http://docs.python.org/ref/Booleans.html}}</ref>
<
>>> class spam: pass # spam is assigned a class object.
...
Line 254:
<class __main__.spam at 0x01292660>
>>>
</syntaxhighlight>
----
----
|