Python/Справочник по языку Python 3.1: различия между версиями

Содержимое удалено Содержимое добавлено
мНет описания правки
Строка 84:
</small>
 
<!-- В комментариях (если не указано иное) - не переведенные исходные тексты -->
== Introduction ==
== Введение ==
 
Это справочное руководство описывает язык программирования Python. Оно не является учебником по программированию.
This reference manual describes the Python programming language. It is not intended as a tutorial.
 
В то время как я пытаюсь быть настолько точным насколько возможно, я хотел использовать английские а не формальные спецификации для всего кроме синтаксиса и лексического анализа. Это должно сделать документ более понятным обычным читателям, но оставляет простор для двусмысленностей. Следовательно, если Вы прибыли с Марса и пробуете заново изобрести Python на основе одного только этого документа, Вам, возможно, придется угадывать некторые вещи, и фактически Вы вероятно закончите тем, что создадите совершенно иной язык программирования. С другой стороны, если Вы используете Python и интересуетесь тем, каковы точные правила для какой-либо области языка, Вы определенно должны найти их здесь. Если Вы хотели бы видеть более формальное определение языка, возможно Вы могли бы добровольно потратить свое время — или изобрести машину для клонирования :-).
While I am trying to be as precise as possible, I chose to use English rather than formal specifications for everything except syntax and lexical analysis. This should make the document more understandable to the average reader, but will leave room for ambiguities. Consequently, if you were coming from Mars and tried to re-implement Python from this document alone, you might have to guess things and in fact you would probably end up implementing quite a different language. On the other hand, if you are using Python and wonder what the precise rules about a particular area of the language are, you should definitely be able to find them here. If you would like to see a more formal definition of the language, maybe you could volunteer your time — or invent a cloning machine :-).
 
Опасно добавлять слишком много подробностей реализации в справочник по языку программирования — реализация может измениться, и другие реализации того же самого языка могут работать иначе. С другой стороны, CPython - одна из реализаций Python, широко используется (хотя дополнительные реализации продолжают поддерживаться), и ее специфические причуды иногда стоят упоминания, особенно тогда, когда реализация налагает дополнительные ограничения. Поэтому Вы найдете короткие “примечания по реализации” разбросанными по всему тексту.
It is dangerous to add too many implementation details to a language reference document — the implementation may change, and other implementations of the same language may work differently. On the other hand, CPython is the one Python implementation in widespread use (although alternate implementations continue to gain support), and its particular quirks are sometimes worth being mentioned, especially where the implementation imposes additional limitations. Therefore, you’ll find short “implementation notes” sprinkled throughout the text.
 
<!-- Every Python implementation comes with a number of built-in and standard modules. These are documented in The Python Standard Library. A few built-in modules are mentioned when they interact in a significant way with the language definition.
 
=== Alternate Implementations ===
Строка 127 ⟶ 128 :
 
Even though the notation used is almost the same, there is a big difference between the meaning of lexical and syntactic definitions: a lexical definition operates on the individual characters of the input source, while a syntax definition operates on the stream of tokens generated by the lexical analysis. All uses of BNF in the next chapter (“Lexical Analysis”) are lexical definitions; uses in subsequent chapters are syntactic definitions.
-->