~ubuntu-branches/ubuntu/karmic/python3.0/karmic

« back to all changes in this revision

Viewing changes to Doc/reference/lexical_analysis.rst

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2009-02-16 17:18:23 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090216171823-1d5cm5qnnjvmnzzm
Tags: 3.0.1-0ubuntu1
New upstream version.

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
to compute the indentation level of the line, which in turn is used to determine
175
175
the grouping of statements.
176
176
 
177
 
First, tabs are replaced (from left to right) by one to eight spaces such that
178
 
the total number of characters up to and including the replacement is a multiple
179
 
of eight (this is intended to be the same rule as used by Unix).  The total
180
 
number of spaces preceding the first non-blank character then determines the
181
 
line's indentation.  Indentation cannot be split over multiple physical lines
182
 
using backslashes; the whitespace up to the first backslash determines the
 
177
Tabs are replaced (from left to right) by one to eight spaces such that the
 
178
total number of characters up to and including the replacement is a multiple of
 
179
eight (this is intended to be the same rule as used by Unix).  The total number
 
180
of spaces preceding the first non-blank character then determines the line's
 
181
indentation.  Indentation cannot be split over multiple physical lines using
 
182
backslashes; the whitespace up to the first backslash determines the
183
183
indentation.
184
184
 
 
185
Indentation is rejected as inconsistent if a source file mixes tabs and spaces
 
186
in a way that makes the meaning dependent on the worth of a tab in spaces; a
 
187
:exc:`TabError` is raised in that case.
 
188
 
185
189
**Cross-platform compatibility note:** because of the nature of text editors on
186
190
non-UNIX platforms, it is unwise to use a mixture of spaces and tabs for the
187
191
indentation in a single source file.  It should also be noted that different
604
608
 
605
609
   7     2147483647                        0o177    0b100110111
606
610
   3     79228162514264337593543950336     0o377    0x100000000
607
 
         79228162514264337593543950336              0xdeadbeef                                              
 
611
         79228162514264337593543950336              0xdeadbeef
608
612
 
609
613
 
610
614
.. _floating:
650
654
part, add a floating point number to it, e.g., ``(3+4j)``.  Some examples of
651
655
imaginary literals::
652
656
 
653
 
   3.14j   10.j    10j     .001j   1e100j  3.14e-10j 
 
657
   3.14j   10.j    10j     .001j   1e100j  3.14e-10j
654
658
 
655
659
 
656
660
.. _operators: