| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 83b9730 commit aa06900
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -285,7 +285,8 @@ Inline markup | |||
| 285 | 285 | As said before, Sphinx uses interpreted text roles to insert semantic markup in | |
| 286 | 286 | documents. | |
| 287 | 287 | ||
| 288 | - Variable names are an exception, they should be marked simply with ``*var*``. | ||
| 288 | + Names of local variables, such as function/method arguments, are an exception, | ||
| 289 | + they should be marked simply with ``*var*``. | ||
| 289 | 290 | ||
| 290 | 291 | For all other roles, you have to write ``:rolename:`content```. | |
| 291 | 292 | ||
@@ -310,7 +311,7 @@ a matching identifier is found: | |||
| 310 | 311 | ||
| 311 | 312 | .. describe:: data | |
| 312 | 313 | ||
| 313 | - The name of a module-level variable. | ||
| 314 | + The name of a module-level variable or constant. | ||
| 314 | 315 | ||
| 315 | 316 | .. describe:: const | |
| 316 | 317 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -328,59 +328,6 @@ I/O Base Classes | |||
| 328 | 328 | ``len(b)``, since if the write fails, an :exc:`IOError` will be raised). | |
| 329 | 329 | ||
| 330 | 330 | ||
| 331 | - Raw File I/O | ||
| 332 | - ------------ | ||
| 333 | - | ||
| 334 | - .. class:: FileIO(name[, mode]) | ||
| 335 | - | ||
| 336 | - :class:`FileIO` represents a file containing bytes data. It implements | ||
| 337 | - the :class:`RawIOBase` interface (and therefore the :class:`IOBase` | ||
| 338 | - interface, too). | ||
| 339 | - | ||
| 340 | - The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, | ||
| 341 | - or appending. The file will be created if it doesn't exist when opened for | ||
| 342 | - writing or appending; it will be truncated when opened for writing. Add a | ||
| 343 | - ``'+'`` to the mode to allow simultaneous reading and writing. | ||
| 344 | - | ||
| 345 | - In addition to the attributes and methods from :class:`IOBase` and | ||
| 346 | - :class:`RawIOBase`, :class:`FileIO` provides the following data | ||
| 347 | - attributes and methods: | ||
| 348 | - | ||
| 349 | - .. attribute:: mode | ||
| 350 | - | ||
| 351 | - The mode as given in the constructor. | ||
| 352 | - | ||
| 353 | - .. attribute:: name | ||
| 354 | - | ||
| 355 | - The file name. This is the file descriptor of the file when no name is | ||
| 356 | - given in the constructor. | ||
| 357 | - | ||
| 358 | - .. method:: read([n]) | ||
| 359 | - | ||
| 360 | - Read and return at most *n* bytes. Only one system call is made, so it is | ||
| 361 | - possible that less data than was requested is returned. Use :func:`len` | ||
| 362 | - on the returned bytes object to see how many bytes were actually returned. | ||
| 363 | - (In non-blocking mode, ``None`` is returned when no data is available.) | ||
| 364 | - | ||
| 365 | - .. method:: readall() | ||
| 366 | - | ||
| 367 | - Read and return the entire file's contents in a single bytes object. As | ||
| 368 | - much as immediately available is returned in non-blocking mode. If the | ||
| 369 | - EOF has been reached, ``b''`` is returned. | ||
| 370 | - | ||
| 371 | - .. method:: write(b) | ||
| 372 | - | ||
| 373 | - Write the bytes or bytearray object, *b*, to the file, and return | ||
| 374 | - the number actually written. Only one system call is made, so it | ||
| 375 | - is possible that only some of the data is written. | ||
| 376 | - | ||
| 377 | - Note that the inherited ``readinto()`` method should not be used on | ||
| 378 | - :class:`FileIO` objects. | ||
| 379 | - | ||
| 380 | - | ||
| 381 | - Buffered Streams | ||
| 382 | - ---------------- | ||
| 383 | - | ||
| 384 | 331 | .. class:: BufferedIOBase | |
| 385 | 332 | ||
| 386 | 333 | Base class for streams that support buffering. It inherits :class:`IOBase`. | |
@@ -438,6 +385,59 @@ Buffered Streams | |||
| 438 | 385 | underlying raw stream cannot accept more data at the moment. | |
| 439 | 386 | ||
| 440 | 387 | ||
| 388 | + Raw File I/O | ||
| 389 | + ------------ | ||
| 390 | + | ||
| 391 | + .. class:: FileIO(name[, mode]) | ||
| 392 | + | ||
| 393 | + :class:`FileIO` represents a file containing bytes data. It implements | ||
| 394 | + the :class:`RawIOBase` interface (and therefore the :class:`IOBase` | ||
| 395 | + interface, too). | ||
| 396 | + | ||
| 397 | + The *mode* can be ``'r'``, ``'w'`` or ``'a'`` for reading (default), writing, | ||
| 398 | + or appending. The file will be created if it doesn't exist when opened for | ||
| 399 | + writing or appending; it will be truncated when opened for writing. Add a | ||
| 400 | + ``'+'`` to the mode to allow simultaneous reading and writing. | ||
| 401 | + | ||
| 402 | + In addition to the attributes and methods from :class:`IOBase` and | ||
| 403 | + :class:`RawIOBase`, :class:`FileIO` provides the following data | ||
| 404 | + attributes and methods: | ||
| 405 | + | ||
| 406 | + .. attribute:: mode | ||
| 407 | + | ||
| 408 | + The mode as given in the constructor. | ||
| 409 | + | ||
| 410 | + .. attribute:: name | ||
| 411 | + | ||
| 412 | + The file name. This is the file descriptor of the file when no name is | ||
| 413 | + given in the constructor. | ||
| 414 | + | ||
| 415 | + .. method:: read([n]) | ||
| 416 | + | ||
| 417 | + Read and return at most *n* bytes. Only one system call is made, so it is | ||
| 418 | + possible that less data than was requested is returned. Use :func:`len` | ||
| 419 | + on the returned bytes object to see how many bytes were actually returned. | ||
| 420 | + (In non-blocking mode, ``None`` is returned when no data is available.) | ||
| 421 | + | ||
| 422 | + .. method:: readall() | ||
| 423 | + | ||
| 424 | + Read and return the entire file's contents in a single bytes object. As | ||
| 425 | + much as immediately available is returned in non-blocking mode. If the | ||
| 426 | + EOF has been reached, ``b''`` is returned. | ||
| 427 | + | ||
| 428 | + .. method:: write(b) | ||
| 429 | + | ||
| 430 | + Write the bytes or bytearray object, *b*, to the file, and return | ||
| 431 | + the number actually written. Only one system call is made, so it | ||
| 432 | + is possible that only some of the data is written. | ||
| 433 | + | ||
| 434 | + Note that the inherited ``readinto()`` method should not be used on | ||
| 435 | + :class:`FileIO` objects. | ||
| 436 | + | ||
| 437 | + | ||
| 438 | + Buffered Streams | ||
| 439 | + ---------------- | ||
| 440 | + | ||
| 441 | 441 | .. class:: BytesIO([initial_bytes]) | |
| 442 | 442 | ||
| 443 | 443 | A stream implementation using an in-memory bytes buffer. It inherits | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -160,11 +160,12 @@ This module also defines four shortcut functions: | |||
| 160 | 160 | ||
| 161 | 161 | Run command with arguments and return its output as a byte string. | |
| 162 | 162 | ||
| 163 | - If the exit code was non-zero it raises a CalledProcessError. The | ||
| 164 | - CalledProcessError object will have the return code in the returncode | ||
| 165 | - attribute and output in the output attribute. | ||
| 163 | + If the exit code was non-zero it raises a :exc:`CalledProcessError`. The | ||
| 164 | + :exc:`CalledProcessError` object will have the return code in the | ||
| 165 | + :attr:`returncode` | ||
| 166 | + attribute and output in the :attr:`output` attribute. | ||
| 166 | 167 | ||
| 167 | - The arguments are the same as for the Popen constructor. Example: | ||
| 168 | + The arguments are the same as for the :class:`Popen` constructor. Example: | ||
| 168 | 169 | ||
| 169 | 170 | >>> subprocess.check_output(["ls", "-l", "/dev/null"]) | |
| 170 | 171 | 'crw-rw-rw- 1 root root 1, 3 Oct 18 2007 /dev/null\n' | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | :synopsis: Interface to the compiler's internal symbol tables. | |
| 6 | 6 | ||
| 7 | 7 | .. moduleauthor:: Jeremy Hylton <jeremy@alum.mit.edu> | |
| 8 | - .. sectionauthor:: Benjamin Peterson | ||
| 8 | + .. sectionauthor:: Benjamin Peterson <benjamin@python.org> | ||
| 9 | 9 | ||
| 10 | 10 | ||
| 11 | 11 | Symbol tables are generated by the compiler from AST just before bytecode is | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,4 +1,4 @@ | |||
| 1 | - # -*- coding: Latin-1 -*- | ||
| 1 | + # -*- coding: latin-1 -*- | ||
| 2 | 2 | ||
| 3 | 3 | """Heap queue algorithm (a.k.a. priority queue). | |
| 4 | 4 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | ||
| 6 | 6 | /* fast search/count implementation, based on a mix between boyer- | |
| 7 | 7 | moore and horspool, with a few more bells and whistles on the top. | |
| 8 | - for some more background, see: http://effbot.org/stringlib */ | ||
| 8 | + for some more background, see: http://effbot.org/stringlib.htm */ | ||
| 9 | 9 | ||
| 10 | 10 | /* note: fastsearch may access s[n], which isn't a problem when using | |
| 11 | 11 | Python's ordinary string types, but may cause problems if you're | |
| Back | FazBrowse Home | New Git URL |
0 commit comments