Category:Python: Difference between revisions
update
(update) |
|||
(14 intermediate revisions by 8 users not shown) | |||
Line 1:
{{language
|exec=interpreted
|site=
|strength=strong
|safety=safe
|express=implicit
|checking=dynamic
|parampass=object reference
|gc=yes
|LCT=yes
|bnf=
It is easy to create clean bug-free programs in Python due to the motto: "Errors should never pass silently." Python is an [[wp:Interpreter (computing)|interpreter]]. Python source files (.py files) are typically compiled to an intermediate [[bytecode]] language (.pyc files) and executed by a Python Virtual Machine.
===Notes===
Because Python uses whitespace for structure, do not format long code examples with leading whitespace, instead use <code><nowiki><pre></pre></nowiki></code> tags, or, preferably, <code><nowiki><syntaxhighlight lang
if True:
Some Python examples may deviate from idiomatic Python because they may be written to work in Python 3.X as well as Python 2.X environments. This includes doing things like:
Line 24 ⟶ 25:
* Conditionally importing reduce if it is not found.
This style is not a requirement for Python code on RC, but it may be in use and should not necessarily be 'corrected' if found in examples.
The command line is often used in Python for short pieces of code, and so, again; examples showing such use are not incorrect and may be left.
==See Also==
* [[wp:python_(programming_language)|Wikipedia: Python]]
==Todo==
[[Tasks_not_implemented_in_Python]]
|