Talk:Python (programming language)/Archive 6: Difference between revisions

Content deleted Content added
MiszaBot I (talk | contribs)
m Archiving 2 thread(s) from Talk:Python (programming language).
Legobot (talk | contribs)
m Bot: Fixing lint errors, replacing obsolete HTML tags: <tt> (1x)
 
(5 intermediate revisions by 3 users not shown)
Line 89:
Thanks --[[user:jhylton|Jeremy Hylton]] <small>—Preceding [[Wikipedia:Signatures|comment]] was added at 23:02, 21 March 2008 (UTC)</small><!--Template:Undated--> <!--Autosigned by SineBot-->
 
:I participated in those discussions as well. SETL was mentioned, but very passingly as an aside; Haskell was the direct inspiration for the syntax and usage. In any case, whatever the factual answer, it needs to be documented and cited... WP isn't aiming at ''true'', it's aiming at ''verifiable'' (many new editors miss this important distinction). If some PEP mentiones SETL, great. Or if you have some statement by the BDFL to this effect (or by some other core developer involved in implementing the feature). Give a concrete citation for the (slightly) controversial claim you wish to add. <font color="darkgreen">[[User:Lulu of the Lotus-Eaters|LotLE]]</font>×<fontspan colorstyle="darkred" size="-2color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk]]</fontspan>]] 14:33, 22 March 2008 (UTC)
 
::A quotation from http://wiki.python.org/moin/PythonVsHaskell, which may be considered an authoritative source in this context:
Line 101:
:::We had been interested in the list comprehensions idea for a while. The email thread on python-dev was about syntax for a feature already in the works. At that point, knowing the Haskell and SETL had both used it successfully was encouraging. Other languages used the same basic feature with this syntax. I recall downloading the SETL docs to take a look. The reason Haskell seems to have entered history as *the* influence is that it is the most modern language that has a similar syntax.--[[User talk:Jhylton|Jhylton]] <small>—Preceding [[Wikipedia:Signatures|comment]] was added at 03:52, 24 March 2008 (UTC)</small><!--Template:Undated--> <!--Autosigned by SineBot-->
 
The main point, in my mind, of mentioning Haskell as an influence is more about its influence on ''itertools'' than on listcomps. Raymond Hettinger explicitly studied the Haskell prologue to evaluate which itertools were important to support. But perhaps we do not mention Haskell's influence in the best way or context (let me go look again). <font color="darkgreen">[[User:Lulu of the Lotus-Eaters|LotLE]]</font>×<fontspan colorstyle="darkred" size="-2color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk]]</fontspan>]] 05:39, 24 March 2008 (UTC)
 
:The text in the history section talks about list comprehensions rather than itertools.--[[Special:Contributions/72.14.228.89|72.14.228.89]] ([[User talk:72.14.228.89|talk]]) 17:04, 24 March 2008 (UTC)
Line 120:
>>> id(s)
3792320
<font color="darkgreen">[[User:Lulu of the Lotus-Eaters|LotLE]]</font>×<fontspan colorstyle="darkred" size="-2color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk]]</fontspan>]] 04:40, 15 April 2008 (UTC)
 
:This might be a tricky concept for users coming from some languages, such as C. Maybe we can come up with a way to cover it. The poster above appears to have confused "immutable" with "constant" (as in C ''const'' variables). --[[User:Fubar Obfusco|FOo]] ([[User talk:Fubar Obfusco|talk]]) 07:27, 15 April 2008 (UTC)
Line 138:
(3792384, 3792352, 3792352)
 
<font color="darkgreen">[[User:Lulu of the Lotus-Eaters|LotLE]]</font>×<fontspan colorstyle="darkred" size="-2color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk]]</fontspan>]] 18:26, 13 June 2008 (UTC)
 
:At least in CPython, the id of an object is its memory address, not the hash of a string. [[User:Fredrik|Fredrik Johansson]] 18:31, 13 June 2008 (UTC)
Line 163:
(25180820, 25180796)
 
::If you do the same thing about reversing the order of assigning strings, you don't get consistent ids. In any case, whatever the assignment of ids, it's an implementation accident, and not part of the actual semantics of Python. <font color="darkgreen">[[User:Lulu of the Lotus-Eaters|LotLE]]</font>×<fontspan colorstyle="darkred" size="-2color:darkgreen;">LotLE</span>]]×[[User talk:Lulu of the Lotus-Eaters|<span style="color:darkred; font-size:x-small;">talk]]</fontspan>]] 19:06, 13 June 2008 (UTC)
 
-----
Line 238:
 
:Does it carry much encyclopedic value? What does it tell us about the language that the [[Python language#Programming philosophy|philosophy section]] doesn't cover? [[User:Hithereimdan|hithereimdan]] ([[User talk:Hithereimdan|talk]]) 22:35, 13 July 2008 (UTC)
== "more-accurate, consensus, well-cited" ==
 
Hi,
 
I don't think [http://en.wikipedia.org/w/index.php?title=Python_%28programming_language%29&diff=220249659&oldid=220231258 this revert] is appropriate, especially given the rationale.
 
# "More accurate" is pretty obviously disputable, from a five-second appraisal of the descriptions of the relevant terms. Python isn't ___domain-specific, which is an important aspect of VHLPLs.
# Claiming consensus on a change which was apparently never discussed (there's nothing regarding it on talk since the change was made) puts a rather excessive amount of weight on the status quo. I'd argue that if this is your criterion for consensus then it lies the other way, given that until said change the article sat the other way for years.
# It's cited to a single book, which incidentally is ''also'' the single source for the claim that "Some high-level programming languages such as Python, Ruby, and Scheme are often considered to be VHLL" on [[very high-level programming language]], and doesn't even give a page number. I assume the "well" part here applies to it being an O'Reilly, but we've had problems with that before - some guy spent weeks reverting people who objected to the obviously incorrect assertion that [[PHP]] was copyrighted to the Apache project, based on an O'Reilly which made that claim.
 
Given that it isn't disputed that Python is high-level, but it ''is'' disputed that it's very high-level, I reckon we should just use high-level. [[user:thumperward|Chris Cunningham (not at work)]] - [[user talk:thumperward|talk]] 11:26, 19 June 2008 (UTC)
 
:If you look at the general usage of VHLL, it's really not the same thing as 5GL, as your "___domain-specific" comment suggests. I.e. look at:
 
:* http://www.usenix.org/publications/library/proceedings/vhll/index.html
:* http://www.oreillynet.com/pub/a/oreilly/news/vhll_1299.html
 
:Since you're proposing a controversial change to the lead (that seems wrong to me, a long-standing editor of that article), please bring it up on discussion for the article rather than just make the change). [[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>]] 17:28, 19 June 2008 (UTC)
 
I agree with Chris that it should be ''high-level programming language'' rather than ''very high-level programming language''. Martinelli's work is an excellent Python reference, and I don't detract from it. But Martinelli is a known Python advocate, and advocacy is not an objective of a Wikipedia article. There's no question that Python is high-level, but "very high-level" is getting more into areas of opinion.
 
Lulu, your work on this article is appreciated, but being a long-standing editor does not bestow any particular weight to your views. I know you're very protective of this article, but this might be a good time for you to re-read [[WP:OWN]]. [[User:TJRC|TJRC]] ([[User talk:TJRC|talk]]) 18:24, 25 June 2008 (UTC)
 
:I was well-familiar with the term VHLL (which precisely matches Python, as well as some "similar languages" like Ruby, Rebol, Perl, xBase, probably Scheme) long before I ever knew Martelli; the citation to him is a perfectly good one, but only inasmuch as it supports a widely understood nomenclature (as it does). This has nothing to do with advocacy—I certainly don't believe a VHLL is generically ''better'' than a HLL—it's simply about stating a more accurate, neutral fact.
 
:FWIW, being a long-standing editor actually ''is'' rather important in evaluating opinions on article changes. Likewise it's of some significance that I'm an actual subject-area expert here as well. Of course I don't [[WP:OWN]] the article, but perhaps you ought to pay a bit of attention to the fact that ''I do know'' what I'm talking about (or read the couple other references I link above, for example). [[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>]] 04:42, 26 June 2008 (UTC)
 
'''Solution: extend the [[Very high-level programming language|VHLL]] article?'''
Since the current VHLL article on Wikipedia is a stub (and the ACM articles require a subscription), it would be a great help if you experts ([[User:Lulu of the Lotus-Eaters|David ]], [[user:thumperward|Chris]] and [[User:TJRC|TJRC]]) could work together to get it into a generally useful state, e.g. so that non-expert software development readers can appreciate the criteria that distinguish VHLLs, HLLs, 4GLs etc. Once that groundwork is in place, it might be appropriate to add sub-sections to show why Python, Ruby &c should be regarded as VHLLs. Any debate could then take place on the VHLL talk page, which would provide a better context for the discussion. Does that work for you? - [[User:Pointillist|Pointillist]] ([[User talk:Pointillist|talk]]) 23:07, 9 July 2008 (UTC)
 
:It does. Admonition acknowledged, [[VHLL]] is very stubby, and I ''am'' someone who should make it better. Time and attention :-). [[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>]] 07:03, 10 July 2008 (UTC)
 
== Slackware Anaconda? ==
 
In the Usage section, this is said:
:Slackware, Red Hat Linux and Fedora use the pythonic Anaconda.
AFAIK, as a long-time Slackware user, Slackware does not use Anaconda. However, not being a Slackware guru, I'm uncomfortable with taking definitive action over this matter. I mean, it would take some work to merge Anaconda into Slackware to make this statement true :D
 
But seriously, if nobody disagrees within a couple days or so, I guess I'll remove Slackware from that list.--[[User:I80and|I80and]] ([[User talk:I80and|talk]]) 13:34, 24 July 2008 (UTC)
== Logo ==
 
Is that snake logo official? According to the creator of Python, the programming language Python does not relate to the snake, but to the Monty python flying circus. The logo should therefore be a big fot IMO.
--[[User:Malin Tokyo|Malin Randstrom]] ([[User talk:Malin Tokyo|talk]]) 07:32, 19 September 2008 (UTC)
:: The logo is however a snake. First one was a little green snake, the recent one is the one you can see in the article. Just go to the official Python site, you’ll see it. [[fr:User:Leafcat|fr:Leafcat]] 13:49, 1 October 2008 (UTC) <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/90.21.71.43|90.21.71.43]] ([[User talk:90.21.71.43|talk]]) </span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
 
== Code samples ==
 
I came across a good non-trivial code sample on the German Wikipedia, an implementation of [[quicksort]]. See [[:de:Python_(Programmiersprache)]].
<syntaxhighlight lang="python">
def quicksort(liste):
if len(liste) <= 1:
return liste
pivotelement = liste[0]
links = [element for element in liste[1:] if element < pivotelement]
rechts = [element for element in liste[1:] if element >= pivotelement]
return quicksort(links) + [pivotelement] + quicksort(rechts)
</syntaxhighlight>
 
Perhaps I'm not looking hard enough, but I don't see an obvious place to put it. I'm also not entirely sure what I need to do GFDL-wise to import the code sample here. [[User:Karl Dickman|Karl&nbsp;Dickman]]&nbsp;[[User talk:Karl Dickman|<sup>talk</sup>]] 21:02, 25 September 2008 (UTC)
 
: [[Python syntax and semantics]]? I'm pretty proud that this article ''doesn't'' have much in the way of code, to be honest. [[user:thumperward|Chris Cunningham (not at work)]] - [[user talk:thumperward|talk]] 21:03, 25 September 2008 (UTC)
== Scripting language? ==
 
The opening paragraph doesn't mention that Python is also a [[scripting language]]. Isn't it? Like scripting languages, it's more interpreted than compiled, it's often used to direct other applications, and allows for unstructured use. Without something of the sort added to the opening, it makes Python sound no better than C or C++, which are also "general purpose high-level programming languages". --[[User:A D Monroe III|A D Monroe III]] ([[User talk:A D Monroe III|talk]]) 13:55, 5 October 2008 (UTC)
 
: Primarily it's an interpreted language, but I also agree with its use as a scripting language. Accordingly, I added some prose to the article for both aspects. [[User:Kbrose|Kbrose]] ([[User talk:Kbrose|talk]]) 15:07, 5 October 2008 (UTC)
 
Trouble is, "scripting language" is a problematic expression. Python is sometimes used for scripting, but it's also used for applications. It certainly isn't a ''systems'' language -- you wouldn't write device drivers in it -- but the notion that every language is either "systems" or "scripting" is a false dichotomy.
 
As for "interpreted", that's also problematic. CPython is a bytecode compiler and virtual machine. (You can get native-code compilation with Psyco, or by using Jython (to generate Java bytecode) and a native-code Java compiler.) Python is never an "interpreter" in the classic sense of a program that converts source code to an [[abstract syntax tree]] and runs the program by walking the tree, like <code>eval</code> in freshman Lisp interpreters.
 
Yes, people often use "interpreter" to mean the Python ''interactive console'', but that's a bit of a solecism. If you define "interpreter" that way, then Python has an interpreter but Perl doesn't -- even though both use the same execution strategy under the hood. (Using "interpreter" to mean "interactive console" also pisses off the Lisp folks, who will point out that [[SBCL]] compiles everything to machine code, even expressions you type in interactively.)
 
The usual expression these days for the class of languages including Python, Perl, and Ruby seems to be "dynamic language". --[[User:Fubar Obfusco|FOo]] ([[User talk:Fubar Obfusco|talk]]) 18:25, 5 October 2008 (UTC)
:But even so, its use as a scripting language is important. For a time, some users of compiled languages tried to dismiss languages such as Python as 'merely scripting' languages in a sort of pejorative fashion. I don't think we should play down this functionality because of that. --[[User:Paddy3118|Paddy]] ([[User talk:Paddy3118|talk]]) 21:10, 5 October 2008 (UTC)
 
::Something like "Python has been successfully embedded in a number of software products as a scripting language"? [[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>]] 22:03, 5 October 2008 (UTC)
 
:::I think LotLE is going in the right direction. Some languages are "scriptable" (i.e. "can be used for efficient scripting"), and others can't. Ideally the various language articles would just say "Xxxx can be used as a [[Scripting language]]", and the [[Scripting language]] article would make it clear what this means. Right now the scripting language article is all over the place, Python and Ruby aren't mentioned anywhere in the body of the article, Javascript and ECMAscript are used as interchangeable terms and—unless you think the statement "Writing in C is much more difficult than writing in the scripting languages." tells the full story—there's no direct explanation of why "systems languages" are not always the ideal tool. I'll take a proper look at it tomorrow - [[User:Pointillist|Pointillist]] ([[User talk:Pointillist|talk]]) 22:47, 5 October 2008 (UTC)
 
::::You might have missed my very discreet smiley. The above quote is already in the article, and has been for a long while. However, I also added a short sentence to the lead that I think makes the association w/o being quite as forced as the earlier change. That said, I just read the [[scripting language]] article too; I agree that that one is a real mess. [[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>]] 22:51, 5 October 2008 (UTC)
 
:::::I was mainly thinking about [[User:Fubar Obfusco|Fubar Obfusco's]] "false dichotomy" point - it would be good if s/he would take a look at [[scripting language]] too (I suspect you two are more polyglottal than I am). - [[User:Pointillist|Pointillist]] ([[User talk:Pointillist|talk]]) 23:10, 5 October 2008 (UTC)