Jump to content

Talk:Python (programming language)/Archive 4

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1Archive 2Archive 3Archive 4Archive 5Archive 6Archive 10

Article naming

I suspect this may have been discussed, but shouldn't the title of this article be python (programming language), since the name of the language seems to be "python", not "python programming language"? - Samsara (talkcontribs) 23:28, 28 July 2006 (UTC)

Precedent suggests otherwise. Ruby programming language, Haskell programming language, Scala programming language, C programming language, Java programming language: all off the top of my head, some quite high-profile languages there, don't follow this convention. If you think a big-ish change in naming style like this is worth it, I suggest asking at a slightly less monolingual talkpage. Some substratum of the Wikipedia:Village Pump perhaps, or Wikipedia:WikiProject Programming languages. --Sam Pointon 23:45, 28 July 2006 (UTC)
Oh, and Wikipedia:Naming conventions#Languages, both spoken and programming and Wikipedia:Naming conventions (languages) (one is policy, the other is a guideline) suggest that the name in current form is canonical. So you'd also have to lobby for change there as well. --Sam Pointon 23:50, 28 July 2006 (UTC)
That was not the point. But... what a mess! - Samsara (talkcontribs) 00:19, 29 July 2006 (UTC)
Agreed. The policy/guidelines don't even explain why they break the near-universal convention used everywhere else (including many non-English Wikipedias' programming language articles). In particular, the above-mentioned guidelines suggest omitting the suffix if the name is unique, so it's clear that the suffix is intended solely for disambiguation, just like normal parenthesized suffixes: why not parenthesize them, then? The only thing the current convention accomplishes is more cumborsome titles, and less convenient linking.
Samsara: this has been bugging me too, for as long as i can remember; if you feel like getting it fixed, count me in. --Piet Delport 11:43, 29 July 2006 (UTC)
I've opened up a 'thread' at Wikipedia talk:WikiProject Programming languages regarding this; i was curious as well. atanamir 21:18, 1 September 2006 (UTC)

Commercial linkspam

We seem to be attracting a bit more of it lately. I think the longstanding editors of this article (and new ones) should keep a particular eye for authors of commercial publications (or their advocates) trying to use the article as a means of free advertising. I got an email from Atanas Radenski who appears to be the author of some commercial training materials called "Python First", and who tried to add such a link, and responded as below:

On 8/17/06, Radenski, Atanas <radenski@chapman.edu> wrote:
> Why do you delete my entry on Python First? It is commercial 
> is a sense but all book references that are still there are at 
> least as commercial as well. Can you help me understand your criteria?

It is commercial linkspam, exactly as my edit comment indicates.  All
the other materials listed are (or should be) freely available (at
very least free-of-cost; usually also free for reuse).  Wikipedia is
an encyclopedia, not a billboard.

> I just got an email by someone who tries to prove that the whole 
> Python project is commercial.

I can't account for what nonsense you might get in email, but Python
is and always has been a Free Software project. --David

Anyway, while Radenski's work is strongly on the commercial side of "commercial links", he also pointed out that we had an existing link to Python Programming for the Absolute Beginner, which is just an ad for a commercially available book. The latter is slightly less "commercial" in the sense it's a regular book with an ISBN that is available from many book sellers. But I think to be clear on the no-advertising standard, we should remove any links that are strictly to non-free texts... at very least things that are free-as-in-beer to everone: Radenski also later pointed out that "educators" might get special qualification for gratis instructor copies of his materials, but that's way shy of a URL to click on to read the material. Still, I can perfectly easily get gratis review copies of pretty much any programming book I want, about as easily as I can order it from Amazon, so limited-purpose gratis fails to wow me (I'm somewhat special in that regard; I turn down a lot more such free-or-cost stuff than I accept). LotLE×talk 02:05, 18 August 2006 (UTC)

For what it's worth, the relevant policy guide is over here: Wikipedia:External links. --Piet Delport 13:34, 19 August 2006 (UTC)

Calling Python slow?

I'm not a big fan of this line:

"Python is notable amongst current popular high-level languages for having a philosophy that emphasizes the importance of the programmer over the importance of the computer (so that, for example, code is slower but easier to understand)"

Yes, Python can be slower at times than another language, but this statement suggests that it's just a slow language altogether. It certainly doesn't seem like a fair thing to say when you are introducing the language. Newcomers might see that, misunderstand, and move on before really understanding what is meant by "slow."

New speed section

I'm not particularly happy with the section called "speed" that an editor added. In the main, it seems to be too much in the advocacy direction, but it also has a bit of an WP:OR-ish feel too it ("a common criticism"?) We're not arguing the pros and cons of Python, but simply presenting its facts. The fact it is an interpretive language is prominently stated already, and its neither the fastest nor the slowest interpreted language (overall it is on the fast end of them, I believe; but certainly not dramatically better than a number of others). And explaining approaches to optimization might be too far into either advocacy or tutorial.

On the other hand, it seems possible to me that several speed issues might be addressed—very concisely—as part of Python's philosophy. I.e. it's probably fast enough now, so don't optimize unless there is a specific problem. If you do optimize, first profile. After you profile, select one or more of: (a) improve algorithms; (b) improve data structures; (c) did we mention (a) and (b)?; (d) look for libraries that exist to do special tasks quickly; (e) run the program with Psyco (if you have an x86-ish platform); (f) rewrite some performance-critical part of code with Pyrex; (g) rewrite some criticial code with SWIG/C or other non-Python wrapped language. LotLE×talk 02:30, 27 August 2006 (UTC)

I agree completely. This is part of my comment below. --JStalk 04:26, 30 August 2006 (UTC)
My thinking behind the "Speed" section was that since people seem to criticize Python because of it, it's worth mentioning that that is a criticism, and the fact that there are methods of dealing with it. Could it be reworded to remove the "advocacy" aspect? As for the "original research," I don't know how that would be dealt with other than finding some Impressive Authority that accuses Python of slowness. Is it better to omit the issue entirely, or find some way of saying "this is kind of a problem but Python fans say it's not major?" --Kris Schnee 19:59, 5 September 2006 (UTC)
Have you read the current version? If so, what do you see as missing? LotLE×talk 20:02, 5 September 2006 (UTC)
The currently live quote marked as needing a citation "Speed is not a problem until it is a problem" should go. While I like the sentiment I've never seen that particular quote on comp.lang.python or python-dev. A search of google, groups.google, and gmane.org turns up squat. Jack Diederich, Jan 10 17:58:03 EST 2007 —The preceding unsigned comment was added by 216.41.15.170 (talk) 22:57, 10 January 2007 (UTC).

Distinction between "language" and "implementation"

Many, many things are slipping into this article that consider Python its own implementation (which it is not). The title of this article is Python programming language, after all. I am reviewing this article for an easy way to tackle this concern.

The concerns I have are with sections such as "Speed" (I echo the concerns of a previous editor here), and details of which platforms Python runs on. These sorts of things may be better applied to an article on CPython. Some implementations of Python (i.e., IronPython) do not have the speed concern because they are compiled to, in IronPython's case, pure .NET IL. Most of these sections are properly flagged with terms like "the standard implementation", which is great, and on the right track.

I can't do anything with this article tonight (PST), but I will be reviewing it more tomorrow. There are several false statements in there regarding Python (and CPython) as well. --JStalk 04:31, 30 August 2006 (UTC)

As of yet, there has not been a clear distinction between "Python the language" and "CPython the implementation". Other implementations are "right inasmuch as they do the same thing as CPython". That will change in the future: Guido van Rossum and Raymond Hettinger are writing a book called The Python Programming Language that will formally specify what the language is... but it hasn't actually been written yet.
In terms of speed, it's not really a CPython thing narrowly. In some limited benchmarks, IronPython and Jython do better; but not everywhere, and not by all that much (certainly compared to hand-tuned C). In any case, all the platforms that have existed (except Psyco, in a way), have had the same basic VM/interpreted-bytecode approach to running programs.
I'm not against clarifying language vs. implementation to some degree. But let's not get ahead of ourself in just how much actual distinction exists. LotLE×talk 04:48, 30 August 2006 (UTC)
I disagree. In an article entitled "x programming language", implementation details (I feel, anyway) must be completely separate or buried under their own heading. The language and implementation are always separate, regardless of language. If this article were entitled Python (computing), I might feel differently. --JStalk 04:52, 30 August 2006 (UTC)
What's the difference between Perl programming language and Perl, the implementation? :-) Obviously, C or Fortran have lots of implementation that well conform to a formal specification. But there is no formal specification of Python anywhere in the world: it's not a standard or anything like that, it's "whatever Guido feels is 'Pythonic'". LotLE×talk 05:08, 30 August 2006 (UTC)

In languages where most users use the same implementation, people tend to get casual and refer to the language having various features which are only properly ascribed to the implementation, such as speed.

Python now has three well-known implementations, with one of them clearly dominant -- CPython -- and two somewhat less used, Jython and IronPython. There are also others which are still little more than curiosities with potential, such as CLPython. As such, it is increasingly obvious that talking about the speed of Python when one means the speed of CPython is, if not flatly wrong, at least somewhat less than encyclopedically accurate. And this is an encyclopedia. We need to make that kind of distinction. --FOo 05:29, 30 August 2006 (UTC)

I'd put it at 2-1/2. I've never really heard of "real life" use of Iron Python yet, just sort of "proof of concept". And a zillion toy implementations: Vyper, PyPy, Parrot, Stackless, Pyvm, there was some Python-to-Lisp thing I recall, Prothon, etc. I think my revision to the "speed" thing gets more implementation-neutral, in any case... it might need a bit of touchup still (Psyco is CPython-specific, for example), but I think we can put it as general "philosophy" rather than go on about bogomips. LotLE×talk 05:39, 30 August 2006 (UTC)
Stackless Python is far from a "toy implementation". It is also not an implementation, it is a patch to CPython.
Before you get too tied up in correcting me for my alleged ignorance of implementations, you might want to take a look at the article I wrote on Stackless in 2000, which was the first widely read of it (outside of Python-specific lists): <http://www-128.ibm.com/developerworks/library/l-pyth7.html?dwzone=linux> LotLE×talk 00:12, 31 August 2006 (UTC)
I was a bit strong there, my apologies. I am currently in two debates; one here, and one at Talk:Virtual memory. My residual hostility from that is carrying over to you, and I apologize.
I'm not going to make any changes to Python, as I'm no longer editing programming articles, so I've said my two words. I'll let you decide how best to treat the article. Sorry to have come off strong, my sincere apologies. --JStalk 00:42, 31 August 2006 (UTC)
Warning: This is PowerPoint. Stackless Python in EVE Online. As demonstrated by the PyCon presentation, the Stackless patch is the complete core of a multiplayer online game that handles more than 30,000 players on one server (on both the 3D graphical client side and the server side).
I would recommend to you that if you plan on caring for this article as much as it seems you do, please research implementations of Python outside of CPython. The distinction between Python itself and CPython is vast, even if it isn't standardized. IronPython isn't a "proof of concept", it's a completed release candidate. It's so new that no apps have been finished on it yet, but I use it heavily in my personal development.
I stand by my opinion on the distinction. This article needs to be rewritten to be more clear on the CPython/Python issue (it is muddy in several places). --JStalk 23:02, 30 August 2006 (UTC)

Requested move

Python programming languagePython (programming language) – Conformance with WP naming conventions LotLE×talk 22:27, 1 September 2006 (UTC)

Wikipedia talk:WikiProject Programming languages/Renaming poll

Ahead of the curve

Since us Pythonistas are in here at the forefront of programming (and since it was discussed here early), I figured I'd go ahead with the needed move, per the rough consensus at Wikipedia talk:WikiProject Programming languages/Renaming poll. I suspect that even though there will be rough consensus for the general move, the safest thing will be to start with the languages that have no objecting editors, and move on to the hold-outs a bit more slowly. It looks like a few of the C folks are overly influenced by K&R's book, for example. LotLE×talk 15:18, 5 September 2006 (UTC)

Do you mind fixing archived talk pages 1 and 2? They're still attached to the old name. I've piped them temporarily. Chris Cunningham 10:32, 1 October 2006 (UTC)

Re-addressing the notion of a criticism section

There really should be some mention of Python's reception. Other than a passing mention to it being used in Google there's very little; I've noticed that Eric Raymond's article on switching to Python (which is one of the more commonly-linked switcher documents) isn't referenced anywhere, nor does there appear to be much in the way of testimony elsewhere. This would be a good way to wrap up the article, which ends rather suddenly just now.

My suggestion is to move the section on Python software down below the philosophy and expand it into a general overview of Python's uptake. Should there be a well-warranted criticism that needs to be mentioned it'd then have a home. Chris Cunningham 10:48, 1 October 2006 (UTC)

Unfortunately, it is difficult to do a criticism section properly (ie, without violating NPOV). The entire speed issue is, actually, a CPython specific one, but because that is the major Python implementation, people associate slowness with Python. A note to the effect of 'this article discusses the abstract idea of the Python language; see X, Y and Z for details of the common implementation' at appropriate places, combined with suitable expansion of CPython, may be a good idea.
However, this does not work as well for the abstract criticisms (and praise, like ESR's article). I agree that notable studies and articles discussing this should get a mention somewhere, but I don't want to see every Tom, Dick and Harry's attack on Python feature X being noted in the article. Perhaps a list of notable commentaries on Python can be compiled and we can work from there?
I have started on the path to all of these, by expanding 'Usage' into a more general response section per the original suggestor's suggestion. The current title ("Response and effects") is far from ideal; I welcome a more fitting name. --88.110.89.171 21:41, 5 October 2006 (UTC)

Half adders and python

how would i implement a few lines of half adder into python

CGI Quick Note

If you are writing code for a windows server make sure you upload your code in 'Binary' and it goes without saying if your write the code for a Linux server uploaded your code in 'Ascii'.

First line in your code for CGI

Windows Severs:

#!c:\python\python.exe

Linux Servers:

#!/usr/bin/python

Python 2.3

#!/usr/bin/python2.3

Python 2.4

#!/usr/bin/python2.4

GrayAlien 02:21, 21 December 2006 (UTC) Gray Alien

With Unix, including Linux: your program, if written as plain text and transferred to a Unix server as a binary or ASCII file will work as line endings are the same. Similarly textual data transferred as ASCII or binary will just work. It is binary data between Unix platforms that should always be transferred as binary data.
It is best when using ftp to transfer data, to always know if the data to be transported is plain text or not. If it is plain text then transfer the file as text and let ftp translate between differing line ending conventions between machines. if it is not 'plain text' then transfer as a binary file for a lossless transmission. I would expect that the same argument holds for Windows but I do not know specifically. --Paddy 04:00, 21 December 2006 (UTC)

emphasizes programmer effort over computer effort

Anyone care to give a quick sketch of what this means in plain English? If not, it would appear to warrant removal. Comments? Thanks! dr.ef.tymac 00:02, 22 December 2006 (UTC)

If you look at languages like BCPL and the C programming language, you had text books showing the kind of instruction sequences that corresponded to the languages statements. Several of their compiler allowed the mixing of assembler statements in with the higher level programming constructs too. Datatypes were much more directly tied to the datatypes of the underlying machine code, (bytes, words).Forth and some varieties of BASIC similarly 'close to the metal'. Pythons has many datatypes such as object, dict, list, tuple, set, string, that are at a higher level of abstraction than what is directly handled by an assembler, and have methods that are easier for the programmer to understand and use. --Paddy 02:56, 22 December 2006 (UTC)
Needs re-wording for clarity: Your summary makes sense, now the issue is how to reword the current phrasing so it conveys the issue more clearly. The current phrasing is close to meaningless. dr.ef.tymac 03:23, 22 December 2006 (UTC)
I have just re-read [1], which shows some of the concerns that do drive Python language features, but you are right. the phrase from the article isn't right. --Paddy 08:53, 22 December 2006 (UTC)

Python Humor

Should we also add PEP 0020, AKA the zen of Python? It's a little easter egg, shown if you type

import this

in python. --Roelt 17:08, 5 January 2007 (UTC)

Odd Wording

In the Python 1 section, there is the sentence "CNRI and the FSF interacted to develop enabling wording changes to the Python's free software license that would make it GPL-compatible.". The "develop enabling wording changes" bit seems oddly worded. It seems that "enabling" is redundant, but I'd like confirmation, or some indication of enabling means in this context if not. Silverfish 10:52, 9 January 2007 (UTC)

It's bureaucratic bafflegab, but what's clearly meant is that the FSF and the Python copyright holders had a chat, and the Python copyright holders decided to change the license to make it GPL-compatible. --FOo 20:41, 9 January 2007 (UTC)
I've delved a bit further, and it looks like the wording (as well as some other content in this article, is taken from the Python 2.0.1 license [2] (and subsequence licenses, the same or similar wording is in the Python 2.5 License). Silverfish 00:18, 10 January 2007 (UTC)

Influences by

Someone trimmed the list of languages that Python was influenced by according to the single-source "computer history chart". That's a perfectly fine chart, but is hardly exhaustive.

In deciding this, you can not go strictly chronologically by order of creation of "version 1.0" (or version 0.1) of the corresponding language. For example, the PEP discussing the introduction of list comprehensions into Python explicitly references the almost identical usage in Haskell; and there was also extensive discussion of the Haskell style on the Python developers list when they were being added. So no, Haskell wasn't an influence on Python 0.9... but it certainly is an important influence on Python 2.5.

Similarly, the Unicode in Python is directly based on Java's handling, and will parallel Java even more closely in Python 3.0 (which incidentally, is now in working alpha, if you look in the right place). Guido van Rossum said as much explicitly (both parts) in his OSCON 2006 talk, among other places (you can cite my coverage at http://www-03.ibm.com/developerworks/blogs/page/davidmertz if you need a reference). And generators were strongly influenced by Icon... I sit a couple chairs over from Raymond Hettinger every day (and talk about this stuff), so I have a pretty good sense of where these ideas came from.

Just to followup on myself: Raymond also explicitly read the Haskell standard prelude when writing much of the itertools module, and some of the names in that are specifically borrowed from Haskell. It's another example of the fact that evolving PLs continue to have new influences. LotLE×talk 06:03, 14 January 2007 (UTC)

I wouldn't object to digging up more explicit citations for some of this, if needed, but let's not throw out the baby with the version 0.9 bath water. LotLE×talk 05:51, 14 January 2007 (UTC)

I think that the list might be a little bit oversealous in attributing influence to languages. Let me go through them and mark the ones I think are slightly dubious and give rationale to the ones I think not:
  1. ABC: Fairly obvious - Guido designed Python to replace ABC, taking the indentation from it, amongst other things
  2. C: Procedural language, like Python. Maybe a little questionable, but I don't think anyone could say that any languages since 1980 haven't been influenced even slightly by C.
  3. Haskell: Directly influenced Python's list comprehension syntax.
  4. Icon: Generators.
  5. Lisp: Has influenced Python's functional capacities, including getting map, filter and lambdas into Python.
  6. Modula-3: Exception handling? In any case, the object system and module system are definitely originally from here.
  7. Perl: Maybe as an example of 'what Python shouldn't be'. Have any features actually been lifted from here?
  8. Smalltalk: It's object-oriented, so's Python.
  9. Tcl: I have no idea why this is here, besides Tkinter, but that's a library and not really part of the core language features.
  10. Java: Several syntaxes have been taken from Java (unified try-except-finally, pie-decorators).
Two or three could stand to be removed. Perl and tcl have the weakest cases, with no direct influence on the core language that I know about. Abednigo 02:10, 15 January 2007 (UTC)
Actually, I think this is about right. The case for TCL seems quite weak to me. Of course some Pythonistas have also used TCL, but there's little direct influence. The regex engine was borrowed from Perl, at least many elements of the extended syntax; but that may not be enough to justify its inclusion. Smalltalk seems pretty iffy too. C is sort of too generic: everyone writes C, and some stuff like string interpolation strings are definitely C; but not a lot of syntax or structure is really C-like. But TCL and Smalltalk should definitely go. LotLE×talk 15:47, 15 January 2007 (UTC)

Image: Python comes with "batteries included"

While python does indeed come with "batteries included", the image Python_batteries_included.jpg doesn't really communicate anything and looks somewhat amateur. That image, which was originally on www.python.org, is no longer displayed there (at least I couldn't find it). I propose that we also remove the image from this page. Comments? Chrike 03:58, 26 January 2007 (UTC)

PEP

How is PEP a unique aspect of Python? As far as I know, many communities has similar processes. It's already described elsewhere in the article, so perhaps it should be removed from that particular section? Debolaz 21:20, 27 January 2007 (UTC)

I'd be fine with that. I put the PEP thing back in the "unique aspects" section, but had overlooked its earlier mention. I think the first mention of PEPs is adequate to cover the concept (it's a little different from other programming communities, but not that different). LotLE×talk 22:53, 27 January 2007 (UTC)
I believe that PEPs influenced tcl's community to do something similar (TEPs?), so, perversely, a mention may now be appropriate under the new header namings. 88.111.227.171 15:35, 28 January 2007 (UTC)
I would be ok with that. Debolaz 23:00, 28 January 2007 (UTC)

History unbalanced

An anon editor added a bunch of material on the history of Python. It all seems accurate and well written. But the overall result is an article that looks very unbalanced, with much more verbiage devoted to the minutia of versions than to any other topic. The gestalt, philosophy, usage, etc. really seem much more important for readers who wonder "so what is this Python thing" than does the year-by-year history.

I'm not sure what the best approach is. Maybe another spin off child article that could have all this detail. Or maybe some way of moving this detail closer to the bottom of the current article. What do editors think? —The preceding unsigned comment was added by Lulu of the Lotus-Eaters (talkcontribs) 02:04, 1 February 2007 (UTC).

Speaking as the anonymous editor who added most of the recent content to the History section, I don't think the imbalance in the article is too bad, or bad enough to warrant taking major action over it. When I was looking over each version's release notes, I was consciously trying to pick out the major details, especially where other languages have influenced Python. Ideally, I would also have added a paragraph or two about, at the very least, how 1.5.2 was, for a while, the most widely delpoyed Python version (this crown seems to have been taken by 2.3 now, though 1.5.2 still has quite some userbase), but I just couldn't find the sources for this.
Given the current set of sources we have to work with, I don't think it's surprising that there's a leaning towards birds-eye overviews (there are so many of these, I can't begin to count them all), and the miniutae of each release (which is supplied in admirable detail by Misc/HISTORY and Misc/NEWS. However, the article does have a fairly meaty philosophy section, as well as a nice lede, so I don't think it's worth getting too worried about for now.
Maybe once I've finished trawling the release notes, there will be a slight problem in the balance department, requiring splitting, but no promises yet ;) 88.111.238.99 16:40, 1 February 2007 (UTC)