Content deleted Content added
m Archiving 2 discussion(s) from Talk:Python (programming language)) (bot |
MalnadachBot (talk | contribs) m Fixed Lint errors. (Task 12) |
||
(10 intermediate revisions by 3 users not shown) | |||
Line 3:
== Indentation not significant? ==
Does anyone besides [[Special:Contributions/Strombrg|Strombrg]] think that Python's use of indentation isn't worth mentioning in the lede? I strongly disagree as it's one of the more unique, useful, and visually striking attributes of the language. --[[User:Cybercobra|<b
:I don't consider it's use of indentation it's core/defining feature, so I also don't consider it significant enough for the lead. Section 4.1 on indentation could make more of a deal about it in comparison to other languages. [[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 05:55, 15 March 2010 (UTC)
Line 9:
:strombrg here: When Python is attacked, it's normally attacked for its whitespace for blocks. It's now one of the things I now love most about the language, but when I first saw it, I thought it was awful - as is the reaction of many others new to the language. Putting something this likely to discourage newcomers in the first paragraph is just asking for trouble. Yes, unusual != bad, but it's important to keep in mind that this perspective is "truer" in technical discussion, not marketing discussion, because it's very common for humans to mistake the descriptive for the normative. <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Strombrg|Strombrg]] ([[User talk:Strombrg|talk]] • [[Special:Contributions/Strombrg|contribs]]) 00:41, 19 March 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
I believe, with Cybercobra, and with the longstanding consensus of article editors, that mentioning Python's indentation block style should be mentioned in the lead. This feature is one of the most widely mentioned aspects of Python in other introductions and discussion of Python. While I entirely agree that the significance of this feature is often exaggerated–both pro and con–the fact it is so frequently mentioned in 3rd party sources makes it notable to readers of the article.
:strombrg: No one's saying it shouldn't be mentioned, and in fact it is mentioned (again, as if once isn't enough) later in the article. I'm just saying it shouldn't be in a "you only get one first impression" spot where newcomers are more likely to be driven away by it - this in combination with the previous "claims to be powerful" stuff read like it was written by someone who hated the language. Please see http://www.se-radio.net/podcast/2006-02/episode-4-scripting-languages for a typical example of how whitespace for block scoping is misperceived outside the python community. <small><span class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Strombrg|Strombrg]] ([[User talk:Strombrg|talk]] • [[Special:Contributions/Strombrg|contribs]]) 18:36, 20 March 2010 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
Line 50:
* Rounding to the nearest smaller integer is floor semantics, not "floor and ceiling".
* Floor and ceiling are simply utility functions, not any sort of "mathematical law". Both of them -- along with the "nearest to zero" rounding performed by some other languages are equally valid mathematically (and to be strictly precise, '''none''' of them follow the generally accepted guidelines for mathematical rounding).
[[User:FellGleaming|<
:Hi Fell. I can see your point, but I'm not happy with the current wording. It seems to imply that Python is out of step with other languages (which it is), but that there is no basis with the decision for Python to floor towards -infinity (which is wrong - it's a clear decision, as your ref clearly shows).
Line 162:
Why does the sidebar say that it's a strong typed language? Duck and dynamic are right, but it's not strong. I'm going to remove this.
<
:Because it is? (see amongst [http://wiki.python.org/moin/Why%20is%20Python%20a%20dynamic%20language%20and%20also%20a%20strongly%20typed%20language this] for instance).--[[User:KimDabelsteinPetersen|Kim D. Petersen]] ([[User talk:KimDabelsteinPetersen|talk]]) 00:54, 7 July 2011 (UTC)
:I think you are confusing strong and static. See our articles on them. --[[User:Cybercobra|<b
== "general purpose" ==
What does "general purpose" mean in the lead here? What would be an example of a non-general purpose programming language? To me, the phrase "general purpose" implies that it's not tied to a specific situation but I think that is implicitly implied when you say "programming language" anyway. Perhaps there's a technical usage of the term I am unaware of. [[User:Jason Quinn|Jason Quinn]] ([[User talk:Jason Quinn|talk]]) 17:28, 29 September 2011 (UTC)
:"General purpose" as opposed to [[___domain-specific language|___domain-specific]] (e.g. [[R (programming language)]], whose use is generally limited to statistics). --[[User:Cybercobra|<b
== Influence by Java, Lisp or Perl ? ==
Line 174:
This three claims do not have any strong backing references. The "Java" thing is especially weird, because
Python was created 4 years *before* Java and I can't even name a single feature added later that would be similar to Java. Dunno about Perl. As for Lisp, we already say it's influenced by Haskell, which is influenced by Lisp - I don't think there was much direct influence. I propose removing all three if no one can come up with citations. [[User:Lrekucki|Lrekucki]] ([[User talk:Lrekucki|talk]]) 07:42, 24 February 2012 (UTC)
:The syntax for decorators, and the <tt>logging</tt> std lib module take direct inspiration from Java. --[[User:Cybercobra|<b
::Agreed about the decorators, but I don't think logging (or unittest based directly on JUnit or any other stdlib module) should be treated as an influence to Python (the language). [[User:Lrekucki|Lrekucki]] ([[User talk:Lrekucki|talk]]) 15:30, 24 February 2012 (UTC)
:With Perl, it's basically an "anti-influence". Python in part define(d) itself in contrast to Perl; see 3rd-to-last paragraph of [[Python_(programming_language)#Programming_philosophy|''Programming philosophy'']]. --[[User:Cybercobra|<b
:: This is a bit confusing. Any standard way to mark this as "anti-influence" as you called it ? [[User:Lrekucki|Lrekucki]] ([[User talk:Lrekucki|talk]]) 15:30, 24 February 2012 (UTC)
On a side note, are there any rules for marking major influences (like marking them as bold) ? [[User:Lrekucki|Lrekucki]] ([[User talk:Lrekucki|talk]]) 15:30, 24 February 2012 (UTC)
:Nope. --[[User:Cybercobra|<b
== Everything is remarkable ==
Line 190:
This "remarkable power..." quote is pure POV puff and should be removed. [[User:Derek farn|Derek farn]] ([[User talk:Derek farn|talk]]) 14:46, 29 May 2012 (UTC)
:Python is generally known for having a comparatively "clean" syntax. The description is from the official FAQ, not some random author, and is appropriately qualified ("claims to", as opposed to a factual "is" statement). "Power" as in being [[high-level programming language|high-level]] (compared to e.g. [[C (programming language)|C]]; it's a [[scripting language]]); do you have a suggestion for a better description for this aspect? --[[User:Cybercobra|<b
::Who is the "generally known"? Has there been a poll of users of different languages? You are now saying Python has "clean syntax" the quote calls it "clear syntax", can you tell me how to measure the cleanness and clearness of a language syntax?
Line 219:
:::[[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 21:45, 4 June 2012 (UTC)
::::I don't see much value in this because only the Python designers really know what "remarkable power" is supposed to refer to. You already said that your interpretation was just a guess.--[[User:Marko Knoebl|Marko Knoebl]] ([[User talk:Marko Knoebl|talk]]) 14:26, 5 June 2012 (UTC)
:::I see no such ambiguity; all 3 phrasings refer to the same property, AIUI. I do admit that it's hard to find a definitive name for the property, though "high-level" seems fairly well accepted. I concur with Peter that we just need to properly attribute the source. Would striking or replacing the "remarkable" qualifier satisfy your concerns? --[[User:Cybercobra|<b
::::Although I do like the whole quote as that what Python (i.e its designers) say about it.
Line 316:
:I agree: I think both should be changed. --[[User:Marko Knoebl|Marko Knoebl]] ([[User talk:Marko Knoebl|talk]]) 10:03, 20 June 2013 (UTC)
== Bullet point list of Uses/Applications ==
I think it would be easier to read the section entitled "Use" if it included a bullet pointed list. Here's a start:
* Scientific computing (NumPy, SciPy, Sage, etc.)
* web dev (Django, etc.)
* admin scripting (Salt, bcfg2, OpenStack)
* game scripting (Civilization 4, etc.)
* 3D applications (Blender, etc.)
* Linux applications (nearly everything in Ubuntu)
* Largescale web development (e.g. Instagram which is Django, Disqus, Quora)
* Game creation (Eve Online, etc.)
* Neuroscience.[http://www.frontiersin.org/neuroinformatics/researchtopics/Python_in_neuroscience/8]
* Bioinformatics
* Crossplatform GUI applications
* Robotics ([[Python Robotics|Pyro]], etc.)
* Raspberry Pi
FYI, the starting point for this list is in this thread: http://www.reddit.com/r/Python/comments/1k74jb/ruby_vs_python/ . There's more good information there on the topic. Perhaps the Use section could even be split in two: "Use" and "Applications," where the Use section discusses the language's popularity generally, while the Applications section has a bullet list like this. Others are welcome to revise/incorporate this comment as they like. Thanks. [[Special:Contributions/107.3.156.34|107.3.156.34]] ([[User talk:107.3.156.34|talk]]) 17:09, 11 February 2014 (UTC)
:I agree. I'm not sure what order those topics should be in, though. [[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 20:56, 11 February 2014 (UTC)
:I disagree. Wikipedia is not reddit - it is an encyclopedia. The [[Wikipedia:Manual of Style/Embedded lists|MOS]] says articles should be primary prose. [[User:Meshach|meshach]] ([[User talk:Meshach|talk]]) 21:22, 11 February 2014 (UTC)
::Perhaps articles should be primarily readable as prose, but there are plenty of examples in Wikipedia of bullet lists being used appropriately within that context. Indeed, this Python article already has ten such bullet lists :), and I would not be supportive of removing them. They're quite helpful for the reader. I'd suggest adding some "meat" to each bullet list that isn't otherwise self-descriptive. [[Special:Contributions/107.3.156.34|107.3.156.34]] ([[User talk:107.3.156.34|talk]]) 22:04, 20 March 2014 (UTC)
== Speed ==
According to an undocumented statement in Wik simple English, running speed for C is (up to?) 200 times faster than Python. Ef this is anywhere near correct, it should be documented and included in our article. [[Special:Contributions/211.225.33.104|211.225.33.104]] ([[User talk:211.225.33.104|talk]]) 06:57, 16 June 2014 (UTC)
:There are several different implementations of Python, and speed is relevant to the implementation rather than to the language. This is also true of C implementations, but the difference in speed is greater with Python than with modern optimising C compilers. Different benchmark programs will also give significantly different results.
:Such a statement belongs in our articles on, for example, [[CPython]] or [[PyPy]], with suitable sources, rather than in this article on the language.-<span style="font-family:cursive; color:grey;">[[User talk:gadfium|gadfium]]</span> 07:48, 16 June 2014 (UTC)
== Python 2 types ==
The table of types only describes Python 3 types, and it describes 'str' as 'A character string: an immutable sequence of Unicode codepoints.' which is of course very true for python 3, but very wrong in python 2. Python 2 is still quite commonly used, and in python 2 str is ASCII rather than unicode, and there is a base type 'basestring' and a subclass 'unicode'.
There are likely other differences between the two versions, and I think it is worth having them side by side in the table, rather than only describe Python 3. The other main difference I can see is that py3 int is essentially the py2 long, and py3 'bytes' is probably buffer() in py2, but I am not sure about that one.
If we didnt include python 2 in the table, I would like to add a note under the table that explains that the Python 3 'str' and 'int' are the Python 2 'unicode' and 'long', and the Python 2 types 'str' and 'int', which existed due to hardware/architecture/performance issues rather than ideal-world language "beauty", have been dropped in Python 3. <span style="font-variant:small-caps">[[User:John Vandenberg|John Vandenberg]] <sup>'''([[User talk:John Vandenberg|chat]])'''</sup></span> 06:00, 12 July 2014 (UTC)
== Influenced Javascript ==
It appears that someone has added "[Citation Needed]" next to Javascript in the Influenced property of the Infobox.
Here are two citations regarding how Python influenced ECMAScript (and, thus, Javascript):
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
* https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Array_comprehensions#Differences_to_the_older_JS1.7.2FJS1.8_comprehensions
[[User:Wes.turner|Wes Turner]] ([[User talk:Wes.turner|talk]]) 21:19, 4 November 2014 (UTC)
: Wouldn't they be more convincing if they contained the word "Python"? [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 21:44, 4 November 2014 (UTC)
== Influenced by Java? ==
The article lists Java as an influence and the citation just mentions decorators as being influenced by Java. That seems like a pretty small influence. Seems like there either needs to be a better citation or maybe Java (which evidently didn't appear until 4 years after Python) shouldn't be on the lengthy list of influences. [[Special:Contributions/50.46.176.46|50.46.176.46]] ([[User talk:50.46.176.46|talk]]) 05:14, 24 October 2014 (UTC)
:It seems to me pretty clear influence. Although Java didn't influence a lot in Python, it clearly influenced decorators. From the ref:
:"Guido took a list of proposals to EuroPython 2004 [7], where a discussion took place. Subsequent to this, he decided that we'd have the Java-style [10] @decorator syntax, and this appeared for the first time in 2.4a2"
:The ref is in a PEP, so it's pretty high-grade ref IMO.
:[[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 09:56, 5 November 2014 (UTC)
:: The trouble is that this is a ''very'' minor influence, yet the hive-mind at WP will probably now categorize Python as a "Java-based language".
:: Decorators didn't come from Java - they were long pre-existing before Java, and before most WP editors were born. What Python took from Java was a convenient syntactic style for representing decorators in source, no more. [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 10:20, 5 November 2014 (UTC)
== Duck typing? ==
Is Python duck typed? re [https://en.wikipedia.org/w/index.php?title=Python_%28programming_language%29&curid=23862&diff=651243176&oldid=651236498]
IMHO, we should take this term out and burn it. The term "duck typing" is badly skunked: it so abused and misused that no-one knows what it means. Firstly few can define it and secondly (and most importantly) it's used to mean two contradictory things so frequently that no-one can ever communicate anything by its use.
"Duck typing" first became popular because Martelli in 2000 [https://groups.google.com/forum/?hl=en#!msg/comp.lang.python/CCs2oJdyuzc/NYjla5HKMOIJ] used it in reference to Python. However (as almost no-one remembers today) he used it ''in contrast'' to Python.
I can define "duck typing". I can even define "duck typing in Python". And if you tell me first whether you think Python is, or is ''not'' duck typed, then I can explain what it means and how Python is (or is not, whichever you favour) following it. The term just has no consistent definition, or a definition that can be in any way illuminating in an article on Python.
[[w:Duck typing]] is beyond hope, but also beyond AfD. However we should not spread the confusion or nonsense further than it has already gone. The term should never be used around Python coders. [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 21:36, 13 March 2015 (UTC)
:Disagree. [[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 01:32, 15 March 2015 (UTC)
:: With what part? [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 01:43, 15 March 2015 (UTC)
{{dedent}}
Hi. I'd like to interrupt and show this example.
<syntaxhighlight lang=python>
class duck:
def quack(self):
print("Quaaaaaack!")
class human:
def quack(self):
print("Fine...quack...happy?")
class dog:
def bark(self):
print("BARK!BARK!")
class cat:
def meow(self):
print("Meeeeeeeow.")
for i in (duck(), cat(), human(), dog()):
try:
i.quack()
except:
print("A %s cannot quack." % i.__class__.__name__)
</syntaxhighlight>
output:
Quaaaaaack!
A cat cannot quack.
Fine...quack...happy?
A dog cannot quack.
The above shows that <code>i</code> will act like a duck and <code>quack()</code> regardless of its class type and it will throw a graceful error if it cannot <code>quack()</code>. This leads me to believe that Python is pretty duck typed. I also disagree. --[[User:I8086|I8086]] ([[User talk:I8086|talk]]) 21:11, 15 March 2015 (UTC)
: Your example doesn't really illustrate the problem. We all know that this is how Python behaves. The question is, ''is this duck typing''? Per Martelli's original association of the term to a Python context, this ''isn't'' duck typing. Duck typing, following the spirit of the original expression "If it walks like a duck and quacks like a duck, then it's a duck" is based on judging a set of behaviours in order to assign an identity. This is not what Python does - Python ''avoids the need'' to deal with such identities, because behaviours (i.e. supported methods) are independent. In Python we just don't care about whether things ''are'' ducks or not, or even if they "can be treated as ducks", we simply work at the level of "Make it quack if it can", "Make it walk if it can" and then we leave it at that.
: The question here for this article is even simpler. If we recognise that "duck typing" is a useless term in software because there is no agreed meaning for it (can you cite a more authoritative source than Martelli?) and that the two meanings differ so far as to simply contradict each other, then does it help or hinder this article to include the term? [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 22:54, 15 March 2015 (UTC)
:: Here's a definition straight from the [http://docs.python.org/3/glossary.html Python Documentation]:
:::A programming style which does not look at an object’s type to determine if it has the right interface; instead, the method or attribute is simply called or used (“If it looks like a duck and quacks like a duck, it must be a duck.”) By emphasizing interfaces rather than specific types, well-designed code improves its flexibility by allowing polymorphic substitution. Duck-typing avoids tests using type() or isinstance(). (Note, however, that duck-typing can be complemented with abstract base classes.) Instead, it typically employs hasattr() tests or EAFP programming.
:: This means you can call a method of any object while having EAFP (like the above example) in case you can't call that said method. So, along with that, I don't see why it should be removed; I find duck typing important. --[[User:I8086|I8086]] ([[User talk:I8086|talk]]) 01:11, 16 March 2015 (UTC)
== Hello world? ==
As you probably know, most programming languages on Wikipedia have a Hello World section. Any chance of adding it? The syntax is pretty simple: `print "Hello, world"` for Python 2.x and `print("Hello, World")` for python 3.x. I would love to add it myself, but I'm no Wikipedia editor. [[Special:Contributions/84.85.246.226|84.85.246.226]] ([[User talk:84.85.246.226|talk]]) 15:45, 31 March 2015 (UTC)
: No. What new facet would this explain about Python? Hello World is, by its nature, trivial. Trivial examples rarely demonstrate much. [[User:Andy Dingley|Andy Dingley]] ([[User talk:Andy Dingley|talk]]) 17:40, 31 March 2015 (UTC)
: Ok, sorry about that :) [[Special:Contributions/84.85.246.226|84.85.246.226]] ([[User talk:84.85.246.226|talk]]) 06:35, 1 April 2015 (UTC)
== Speed comparison ==
Pythonics find solutions without Java three times faster with Python.
Non-Pythonics can't write Pythonic. <small><span class="autosigned">— Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[User:Wiki lofi|Wiki lofi]] ([[User talk:Wiki lofi|talk]] • [[Special:Contributions/Wiki lofi|contribs]]) 07:55, 25 August 2015 (UTC)</span></small><!-- Template:Unsigned --> <!--Autosigned by SineBot-->
== External links modified ==
Hello fellow Wikipedians,
I have just added archive links to {{plural:3|one external link|3 external links}} on [[Python (programming language)]]. Please take a moment to review [https://en.wikipedia.org/w/index.php?diff=prev&oldid=678093903 my edit]. If necessary, add {{tlx|cbignore}} after the link to keep me from modifying it. Alternatively, you can add {{tlx|nobots|deny{{=}}InternetArchiveBot}} to keep me off the page altogether. I made the following changes:
*Attempted to fix sourcing for https://www.python.org/dev/intro/
*Added archive https://web.archive.org/20140423121309/http://www.jasc.com/support/customercare/articles/psp9components.asp to http://www.jasc.com/support/customercare/articles/psp9components.asp
*Added archive https://web.archive.org/20121101045354/http://wiki.python.org:80/moin/PythonForArtificialIntelligence to https://wiki.python.org/moin/PythonForArtificialIntelligence
When you have finished reviewing my changes, please set the ''checked'' parameter below to '''true''' to let others know.
{{sourcecheck|checked=false}}
Cheers. —[[User:Cyberbot II|<sup style="color:green;font-family:Courier;">cyberbot II</sup>]]<small><sub style="margin-left:-14.9ex;color:green;font-family:Comic Sans MS;">[[User talk:Cyberbot II|<span style="color:green;">Talk to my owner</span>]]:Online</sub></small> 10:17, 27 August 2015 (UTC)
== There is no word about the best GUI builder: Qt_Designer. Why? ==
I had been struggling for years with terrible Tkinter, wxPython, BOA, Glide, etc. until I discovered [[PyQt]] with its fantastic VISUAL [[Qt_Designer]], which is free software. [[Special:Contributions/85.193.214.150|85.193.214.150]] ([[User talk:85.193.214.150|talk]]) 18:18, 12 October 2015 (UTC)
:If you can come up with a reliable, third-party reference (or two) stating this, then feel free to add it in. Although I would say terms like 'the best' and 'terrible' and 'fantastic' are quite subjective. There are also issues around licensing: PyQT has GPL but not LGPL, which may affect some uses/users.
: [[User:Peterl|peterl]] ([[User talk:Peterl|talk]]) 09:11, 13 October 2015 (UTC)
|