Talk:Python (programming language)/Archive 6
![]() | This is an archive of past discussions about Python (programming language). Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | ← | Archive 4 | Archive 5 | Archive 6 | Archive 7 | Archive 8 | → | Archive 10 |
First on Google
I find it humorous that Python (programming language), rather than Python is the first result on Google for wikipedia+python.71.167.32.238 (talk) 18:58, 6 December 2007 (UTC)
Wikimedia Python Examples?
Hi, (please excuse me if this is not the right place for my entry). In the near future and for at least a couple of years it seems we will be having mainstream Python2.x and Python 3.y Python distributions with divergent syntax. What happens to the number of Python examples throughout Wikipedia?
I would favour a solution that would keep Python examples as meaning 2.x examples as it is now, and for Python 3.y examples to be explicitly stated as such, (including the syntax highlighter). I think examples in both versions should co-exist for a time. --Paddy (talk) 07:34, 8 December 2007 (UTC)
Modified the intro a bit
I edited the line in the intro that said "Python...emphasizes the importance of programmer effort over computer effort." I understand what this is trying to say, but it's ambiguous short-hand programmer-speak. A newbie could even interpret it as meaning that Python emphasizes that it's important for programmers to put in more effort. See what I mean? The tradeoff with execution time may be relevant, but doesn't need to be in the intro. C1932 (talk) 04:46, 24 January 2008 (UTC)
- Good call. Chris Cunningham (talk) 10:20, 24 January 2008 (UTC)
Python (mythology), the oracular serpent of Delphi (pun intended?)
Hello everyone,
I hope not to disturb your work, but here is a small curiosity:
I just did a search for Python and got to the disambiguation page, where it says:
Python (mythology), the oracular serpent of Delphi
While on the Borland Delphi-page is stated about the name of the programming language:
"If you want to talk to [the] Oracle, go to Delphi"
..I'm confused! ;) 139.91.179.210 (talk) 18:55, 31 January 2008 (UTC)
- It is a coincidence. The name of the Python language comes from Monty Python's Flying Circus and has nothing to do with nasty reptiles.[1] --Lambiam 06:54, 1 February 2008 (UTC)
- At least that's the surface association. If you look at any documentation, source files, system resources or third-party references or books written on the subject matter of this article, you will see serpents. dr.ef.tymac (talk) 16:20, 1 February 2008 (UTC)
- The association is after-the-fact; the name of the language is older than any of these.[2] The keywords "Spanish Inquisition" and "SPAM" should tell you something. The first O'Reilly book with a snake on the cover is from 2003. --Lambiam 03:30, 2 February 2008 (UTC)
- None of this contradicts my earlier statement. One might also question the conclusions of "coincidence" and "after-the-fact", since even if the association were purely recent, that does not negate that associations, just like programming languages, change over time.
- See also What is python? which states in relevant part: python, (Gr. Myth. An enormous serpent that lurked in the cave of Mount Parnassus and was slain by Apollo). (date: may 1997). dr.ef.tymac (talk) 04:11, 4 February 2008 (UTC)
- What makes you think this quote is relevant to the issue of where the name of the programming language came from? --Lambiam 10:21, 4 February 2008 (UTC)
- Please re-see the prior posts to this thread (including yours). You'll notice the word association. Consider how this concept is distinct from origination. The stated intent in establishing a term is not necessarily the exclusive (or even primary) source of current meaning for that term.
- This is *especially* true when the person credited with the original intent does nothing to disclaim (indeed, endorses) alternate interpretations. dr.ef.tymac (talk) 13:27, 4 February 2008 (UTC)
- I only see the word association in this thread, starting with your "surface association". I maintain that the association between the Delphi snake and the language is after-the-fact. Being an association that is made later does not negate the association by itself, but it is still an association that is made later. Where do you find such endorsements of "alternate" interpretations? For a disclaimer, see http://www.python.org/search/hypermail/python-1992/0001.html. --Lambiam 21:26, 4 February 2008 (UTC)
- I've never seen a quote by GvR stating "the name python has nothing to do with ... reptiles". Do you know of one? I'd be happy to read it. An unequivocal repudiation of reptile references (as well as the de-facto "mascot") by GvR would bolster your original assertion quite a bit. Terse quasi-disclaimers such as the one you cited above, I respectfully suggest, do not. dr.ef.tymac (talk) 00:24, 5 February 2008 (UTC)
- There is also no unequivocal repudiation by the Pope of the association of Roman Catholicism with the Rose Cross. So does this mean we are at liberty to herald that Roman Catholicism is associated with Rosicrucianism, using the lack of a solemn papal disavowal as corroborating evidence? The disclaimer I cited may be terse, but it is by no means a quasi-disclaimer. Your use of that terminology amounts to innuendo that the BDFL is lying in his response that there is nothing deep about it. --Lambiam 09:41, 5 February 2008 (UTC)
- No, it amounts to the very simple point that your assertion could use some direct substantiation, as it would enhance the credibility of your apparent claim. This really has zero to do with irrelevant speculation about GvR's integrity or abstruse analogies.
"Nothing deep about it" != "has nothing to do with reptiles"
. "Nothing deep" could mean anything, it doesn't clarify the issue. Language itself is "deep" (programming, natural, or otherwise). - If you've anything more specific, feel free to drop it at my user space, as this thread is getting a bit long in the tooth. Regards, dr.ef.tymac (talk) 11:31, 5 February 2008 (UTC)
- No, it amounts to the very simple point that your assertion could use some direct substantiation, as it would enhance the credibility of your apparent claim. This really has zero to do with irrelevant speculation about GvR's integrity or abstruse analogies.
- There is also no unequivocal repudiation by the Pope of the association of Roman Catholicism with the Rose Cross. So does this mean we are at liberty to herald that Roman Catholicism is associated with Rosicrucianism, using the lack of a solemn papal disavowal as corroborating evidence? The disclaimer I cited may be terse, but it is by no means a quasi-disclaimer. Your use of that terminology amounts to innuendo that the BDFL is lying in his response that there is nothing deep about it. --Lambiam 09:41, 5 February 2008 (UTC)
- I've never seen a quote by GvR stating "the name python has nothing to do with ... reptiles". Do you know of one? I'd be happy to read it. An unequivocal repudiation of reptile references (as well as the de-facto "mascot") by GvR would bolster your original assertion quite a bit. Terse quasi-disclaimers such as the one you cited above, I respectfully suggest, do not. dr.ef.tymac (talk) 00:24, 5 February 2008 (UTC)
Quoting the python.org website:
“ | By the way, the language is named after the BBC show ``Monty Python's Flying Circus'' and has nothing to do with nasty reptiles.[3] | ” |
For me this is an authoritative direct substantiation, with or without GvR's assertion. --Lambiam 16:43, 5 February 2008 (UTC)
- Yes, that is pretty direct alrighty! Perhaps now we should get together and tell them their website has been hacked, as someone has replaced their Favicon with this: Image:Python org favicon.png! ... Oh wait, perhaps that isn't a nasty reptile, just a cute and cuddly friendly reptile, or perhaps it's a green stick with a tongue, or ... (insert fanciful explanation here). dr.ef.tymac (talk) 05:08, 6 February 2008 (UTC)
- Follow up: Yes, I know, I don't dispute your claim about the origin story for the language name (and never did), but the irony was just too good to pass up. Cheers. dr.ef.tymac (talk) 05:12, 6 February 2008 (UTC)
hello world?
don't want to be annoying, but shouldn't a page on a programming language include the traditional "hello, world!" program example thing? i mean it's a standard for presenting a programming language 89.123.249.91 (talk) 17:39, 15 February 2008 (UTC)
Phillip J Eby Search
I searched for Phillip J Eby on Wikipedia: http://en.wikipedia.org/wiki/Special:Search?search=%22Phillip+J+Eby%22&go=Go
One of the results was:
- Python (programming language)
- ...Guido | last = van Rossum | coathors = Phillip J. Eby | work = Python Enhancement Proposals | publisher...
- Relevance: 88.6% - 44 KB KiB (6330 words) - 14:31, March 12, 2008
I've followed the link to this page and there's no text anything like that. I checked recent history, too. What gives?
Thanks --Irrevenant [ talk ] 03:05, 13 March 2008 (UTC)
- I've fixed a typo in the field name "coauthors", which caused the name of Phillip J. Eby not to appear. --Lambiam 19:43, 13 March 2008 (UTC)
Influences
There seems to be some back and forth on languages that influenced Python. I'm not sure the best way to come to an agreement (as I'm a newbie here). I offered a recent change based on first-hand experience as a Python developer. In the example in question, I amended the description of list comprehension influences to include SETL, because SETL and Haskell were the two languages with list comprehensions that the developers discussed when designing the feature. Should I document my own recollections elsewhere, then cite them as a reference? That seems like a tedious thing to do for all changes, but perhaps is useful for changes where there is disagreement.
Thanks --Jeremy Hylton —Preceding comment was added at 23:02, 21 March 2008 (UTC)
- 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. LotLE×talk 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:
- "Python's list comprehension syntax is taken (with trivial keyword/symbol modifications) directly from Haskell."
- There are several indirect influences of SETL. One goes along the line SETL → ABC → Python. It regards the design decision to have a small set of powerful high-level datatypes.[4] Likewise, there is the line SETL → Haskell → Python [5]. Jeremy may be remembering seeing that message.
- So it is true in some sense that SETL was an influence, but it is not doable in general to start listing indirect influences; almost everything that Python's designers borrowed from other languages has a pedigree. --Lambiam 21:57, 22 March 2008 (UTC)
- A quotation from http://wiki.python.org/moin/PythonVsHaskell, which may be considered an authoritative source in this context:
- Thanks for the extended discussion. I agree that I was worried about writing something true rather than verifiable. Unfortunately, lots of the reasons for the design decisions took place in office conversations that didn't make it to email. Python development circa 2000 involved a fair amount of face-to-face conversation among the core developers.
- The problem with the claim that Haskell was the direct influence is that it wasn't. Tim Peters captured it well in an email:
- "He decided listcomps "were Pythonic" before knowing anything about Haskell (or SETL, from which Haskell took the idea). Given that he *already* liked them, the value in looking at Haskell is for its actual experience with them. It would be pretty stupid *not* to look at experience with other languages that already have it!"[6]
- 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.--Jhylton —Preceding comment was added at 03:52, 24 March 2008 (UTC)
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). LotLE×talk 05:39, 24 March 2008 (UTC)
- The text in the history section talks about list comprehensions rather than itertools.--72.14.228.89 (talk) 17:04, 24 March 2008 (UTC)
external links
I am adding a link to my website where I show how to install Python on Windows Vista. It is not intuitive and I think it is a useful addition to this page. (Neuralwiki (talk) 04:13, 24 March 2008 (UTC))
immuteable strings?
For the data type str and unicode it says it's "An immutable sequence of characters". I'm not a python expert but this seems incorrect to me. You can definitely change a string or unicode. —Preceding unsigned comment added by 74.61.6.82 (talk) 21:20, 13 April 2008 (UTC)
- Actually, you can't change a string or unicode. You can create a new one and bind it to the same name as the old one; and then the old one is discarded. TJRC (talk) 19:25, 14 April 2008 (UTC)
>>> s = "foo" >>> id(s) 3792352 >>> s = s+"bar" >>> id(s) 3792320
LotLE×talk 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). --FOo (talk) 07:27, 15 April 2008 (UTC)
- I agree with David, the example he shows indicates that the strings are not immutable, at least not in the sense that a functional programming language would consider immutability. —Preceding unsigned comment added by 76.87.74.5 (talk) 23:19, 21 May 2008 (UTC)
I wonder if I'm "David" in 76.87..'s comment (it's my name, but not my username; not hard to figure out though). In any case, the example really does show immutability, even in an FP sense. The point is that the object whose id is 3792353 can never be anything other than "foo" (during that interpreter run; of course that id might be used for something else during a different run). 's' happens to be a way to refer to object 3792352. If nothing refers to that object, it will be garbage collected at some point too. But I might also refer to object 3792352 in other ways, e.g. (I don't even have to fake id's since as an implementation accident, ids are just hashes of strings, more-or-less):
>>> s = "foo" >>> id(s) 3792352 >>> s2 = s >>> l = [s] >>> s = s+"bar" >>> s
'foobar'
>>> id(s), id(l[0]), id(s2) (3792384, 3792352, 3792352)
LotLE×talk 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. Fredrik Johansson 18:31, 13 June 2008 (UTC)
- Sorry, you're right. I think it's only ints that get special ids, the string example was just an accident of determinism (I was thinking that was in the mechanism for string interning, but it apparently isn't). Maybe ints aren't even quite deterministic either, but this is interesting:
[~]$ python Python 2.4.2 (#1, Mar 22 2006, 18:15:19) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> n = 1234 >>> id(n) 25180820 >>> m = 2345 >>> id(m) 25180796 [~]$ python Python 2.4.2 (#1, Mar 22 2006, 18:15:19) [GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> m = 2345 >>> n = 1234 >>> id(n), id(m) (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. LotLE×talk 19:06, 13 June 2008 (UTC)
Hmm, more confusion, at least as far as Python is concerned. Python immutability is not a property of variable names; a variable can (more or less) always be rebound. Python immutability is a property of data objects, and has to do with whether their contents can be altered in place.
>>> nums = [1, 2, 3] >>> nums[0] 1 >>> nums[0] = 42 >>> nums [42, 2, 3] >>> wiki = "Wikipedia" >>> wiki[0] 'W' >>> wiki[0] = "P" Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: object does not support item assignment
As you can see, the array in the variable nums
can have its contents altered, but the string in the variable wiki
cannot. However, it's perfectly legal to rebind the variable to a whole new value:
>>> wiki = 42 >>> wiki = nums >>> wiki = "Wikipedia" >>> wiki = wiki + wiki >>> wiki 'WikipediaWikipedia'
This is likewise what's going on in the above s = s + "bar"
example. A new string object is being conjured up by the s + "bar"
expression, and then the variable s
is pointed to that object. The string it previously pointed to may perhaps be garbage-collected, since it does not share structure with the new one. --FOo (talk) 10:11, 13 June 2008 (UTC)
Python's colon is the appendix of the language.
The colon serves no useful purpose in the syntax parsing of the language. Why is it then required by the parser? It inhibits the natural expression of logic as part of program flow by adding a nonsensical characters for block delineation. See the following links for a discussion of the issue, [7] [8]. —Preceding unsigned comment added by 24.142.120.234 (talk) 07:39, 1 May 2008 (UTC)
- Is there a reason to bring this up on Wikipedia? rspeer / ɹəədsɹ 08:06, 1 May 2008 (UTC)