Skip to content

Commit a9453ee

Browse files
committed
some updates
1 parent 95a0b93 commit a9453ee

File tree

13 files changed

+374
-91
lines changed

13 files changed

+374
-91
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Welcome to the Python Reference (the Right Way) repository.
33

44
Date: Tue Jan 27 2015
55

6-
This repository contains all of the source documents that are used to generate
6+
This repository contains all of the source files that are used to generate
77
the above documentation.
88

9-
Email Jakub Przywóski <[email protected]> with questions or comments.
9+
Email Jakub Przywóski <[email protected]> with questions or comments.

source/docs/bytearray/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,20 @@ An example of a bytearray length 4.
1414

1515

1616
Constructors
17-
------------
17+
====
1818
`bytearray()`_
1919
Returns a new bytearray object.
2020

2121
Methods
22-
----
22+
====
2323
`fromhex`_
2424
Returns a new bytearray object initialized from a string of hex numbers.
2525

2626
`Methods Inherited From str`_
27-
----
27+
====
2828

2929
`Methods Inherited From list`_
30-
----
30+
====
3131

3232
.. _bytearray(): ../functions/bytearray.html
3333
.. _fromhex: fromhex.html

source/docs/complex/index.rst

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
=======
1+
====
22
complex
3-
=======
3+
====
44

55
Complex numbers are an extension of the familiar real number system in which all numbers are expressed as a sum of a real part and an imaginary part. Imaginary numbers are real multiples of the imaginary unit (the square root of -1), often written i in mathematics or j in engineering. Python has built-in support for complex numbers, which are written with this latter notation; the imaginary part is written with a j suffix, e.g., 3+1j. To get access to complex equivalents of the math module, use cmath. Use of complex numbers is a fairly advanced mathematical feature. If you’re not aware of a need for them, it’s almost certain you can safely ignore them.
66

77
Complex numbers are stored as a pair of machine-level double precision floating point numbers.
88

99
Constructors
10-
------------
10+
====
1111
`complex()`_
1212
Returns an expression converted into a complex number.
1313
`Literal Syntax`_
1414

1515
Properties
16-
----------
16+
====
1717
`real`_
1818
Retrieves the real component of this number.
1919
`imag`_
2020
Retrieves the imaginary component of this number.
2121

2222
Methods
23-
-------
23+
====
2424
`conjugate`_
2525
Returns the complex conjugate.
2626

@@ -29,7 +29,3 @@ Methods
2929
.. _real: real.html
3030
.. _imag: imag.html
3131
.. _conjugate: conjugate.html
32-
33-
34-
35-

source/docs/float/index.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
1-
=====
1+
====
22
float
3-
=====
3+
====
44

55
These represent machine-level double precision floating point numbers. You are at the mercy of the underlying machine architecture (and C or Java implementation) for the accepted range and handling of overflow. Python does not support single-precision floating point numbers; the savings in processor and memory usage that are usually the reason for using these is dwarfed by the overhead of using objects in Python, so there is no reason to complicate the language with two kinds of floating point numbers.
66

77
Floating point numbers are usually implemented using double in C; information about the precision and internal representation of floating point numbers for the machine on which your program is running is available in sys.float_info.
88

99
Constructors
10-
------------
10+
====
1111
`float()`_
1212
Returns an expression converted into a floating point number.
1313
`Literal Syntax`_
1414

1515
Scientific Notation
16-
-----------------
16+
====
1717
`e | E (scientific notation)`_
1818
Returns a float multiplied by the specified power of 10.
1919

2020
Methods
21-
-------
21+
====
2222
`as_integer_ratio`_
2323
Returns a pair of integers whose ratio is exactly equal to the original float and with a positive denominator.
2424
`is_integer`_

source/docs/ints/index.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
===
1+
====
22
int
3-
===
3+
====
4+
45
These represent numbers in the range -2147483648 through 2147483647. (The range may be larger on machines with a larger natural word size, but not smaller.) When the result of an operation would fall outside this range, the result is normally returned as a long integer (in some cases, the exception OverflowError is raised instead). For the purpose of shift and mask operations, integers are assumed to have a binary, 2’s complement notation using 32 or more bits, and hiding no bits from the user (i.e., all 4294967296 different bit patterns correspond to different values).
56

67
Plain integers (also just called integers) are implemented using long in C, which gives them at least 32 bits of precision (sys.maxint is always set to the maximum plain integer value for the current platform; the minimum value is -sys.maxint - 1). Long integers have unlimited precision.
78

89
Numbers are created by numeric literals or as the result of built-in functions and operators. Unadorned integer literals (including binary, hex, and octal numbers) yield plain integers unless the value they denote is too large to be represented as a plain integer, in which case they yield a long integer. Integer literals with an 'L' or 'l' suffix yield long integers ('L' is preferred because 1l looks too much like eleven!).
910

1011
Constructors
11-
------------
12+
====
1213
`int()`_
1314
Returns an expression converted into an integer number.
1415
`int Literal Syntax`_
1516

1617
Base Designators
17-
----------------
18+
====
1819
`0... (Base Designators)`_
1920
Returns a decimal integer converted from the specified base.
2021

2122
Methods
22-
-------
23+
====
2324
`bit_length`_
2425
Returns the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros.
2526

source/docs/ints/indexl.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@ long
44
These represent numbers in an unlimited range, subject to available (virtual) memory only. For the purpose of shift and mask operations, a binary representation is assumed, and negative numbers are represented in a variant of 2’s complement which gives the illusion of an infinite string of sign bits extending to the left.
55

66
Constructors
7-
------------
7+
====
88
`long()`_
99
Returns an expression converted into a long integer number.
1010
`long Literal Syntax`_
1111

1212
Base Designators
13-
----------------
13+
====
1414
`0... (Base Designators)`_
1515
Returns a decimal integer converted from the specified base.
1616

1717
Methods
18-
-------
18+
====
1919
`bit_length`_
2020
Returns the number of bits necessary to represent an integer in binary, excluding the sign and leading zeros.
2121

source/docs/list/index.rst

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,27 @@
11
====
22
list
33
====
4-
5-
Lists are mutable ordered and indexed collections of objects. Often called arrays in other languages. The items of a list are arbitrary Python objects. Lists are formed by placing a comma-separated list of expressions in square brackets. (Note that there are no special cases needed to form lists of length 0 or 1.)
4+
Lists are mutable ordered and indexed collections of objects. The items of a list are arbitrary Python objects. Lists are formed by placing a comma-separated list of expressions in square brackets. (Note that there are no special cases needed to form lists of length 0 or 1.)
65

76
Constructors
8-
============
7+
====
98
`list()`_
109
Converts an object into a list.
1110
`[] list comprehensions`_
1211
Returns a list based on existing iterables.
1312
`literal syntax`_
14-
15-
Misc
13+
Initializes a new instance of the **list** type.
14+
15+
Operators
1616
====
1717
`[] (index operator)`_
1818
Gives access to a sequence's element.
1919
`[::] (slicing)`_
2020
Gives access to a specified range of sequence's elements.
21+
`+ (concatenation)`_
22+
Returns a concatenation of two sequences.
23+
`* (multiple concatenation)`_
24+
Returns a sequence self-concatenated specified amount of times.
2125

2226
Functions
2327
====
@@ -27,6 +31,8 @@ Functions
2731
Returns the smallest item from a collection.
2832
`max`_
2933
Returns the largest item in an iterable or the largest of two or more arguments.
34+
`cmp`_
35+
Compares two objects and returns an integer according to the outcome.
3036
`sum`_
3137
Returns a total of the items contained in the iterable object.
3238
`sorted`_
@@ -43,10 +49,10 @@ Functions
4349
Returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.
4450

4551
Methods
46-
=======
52+
====
4753

4854
Adding Elements
49-
_______________
55+
----
5056
`insert`_
5157
Inserts an item at a given position.
5258
`append`_
@@ -55,14 +61,14 @@ _______________
5561
Extends the list by appending all the items from the iterable.
5662

5763
Deleting
58-
________
64+
----
5965
`remove`_
6066
Removes the first item from the list which matches the specified value.
6167
`pop`_
6268
Removes and returns the item at the specified index.
6369

6470
Information
65-
___________
71+
----
6672
`index`_
6773
Returns the index of the first occurrence of the specified list item.
6874
`count`_
@@ -80,7 +86,6 @@ ___________
8086
.. _remove: remove.html
8187
.. _index: lindex.html
8288
.. _count: count.html
83-
8489
.. _enumerate: ../functions/enumerate.html
8590
.. _len: ../functions/len.html
8691
.. _reversed: ../functions/reversed.html
@@ -92,3 +97,5 @@ ___________
9297
.. _min: ../functions/min.html
9398
.. _all: ../functions/all.html
9499
.. _any: ../functions/any.html
100+
.. _+ (concatenation): ../operators/concatenation.html
101+
.. _* (multiple concatenation): ../operators/multiple_concatenation.html

source/docs/memoryview/index.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ memoryview
44

55

66
Constructors
7-
------------
7+
====
88
`memoryview()`_
99
Returns a new memoryview object.
1010

1111
Methods
12-
----
12+
====
1313
`tobytes`_
1414
Returns the data in the buffer as a string.
1515
`tolist`_
1616
Returns the data in the buffer as a list of integers.
1717

1818
Properties
19-
----
19+
====
2020
`format`_
2121
Returns a string containing the format (in struct module style) for each element in the view.
2222
`itemsize`_

source/docs/sets/index.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Sets do not record element position or order of insertion. Accordingly, sets do
99
Sets are implemented using dictionaries. They cannot contain mutable elements such as lists or dictionaries. However, they can contain immutable collections.
1010

1111
Constructors
12-
------------
12+
====
1313
`set()`_
1414
Returns a set type initialized from iterable.
1515
`{} set comprehension`_
@@ -40,17 +40,17 @@ Functions
4040
Returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.
4141

4242
Methods
43-
-------
43+
====
4444

4545
Adding Elements
46-
_______________
46+
----
4747
`add`_
4848
Adds a specified element to the set.
4949
`update`_
5050
Adds specified elements to the set.
5151

5252
Deleting
53-
________
53+
----
5454
`discard`_
5555
Removes an element from the set.
5656
`remove`_
@@ -61,7 +61,7 @@ ________
6161
Removes all elements from the set.
6262

6363
Information
64-
___________
64+
----
6565
`issuperset`_
6666
Returns a Boolean stating whether the set contains the specified set or iterable.
6767
`issubset`_
@@ -70,7 +70,7 @@ ___________
7070
Returns a Boolean stating whether the set contents do not overlap with the specified set or iterable.
7171

7272
Set Operations
73-
______________
73+
----
7474
`difference`_
7575
Returns a new set with elements in the set that are not in the specified iterables.
7676
`intersection`_
@@ -81,7 +81,7 @@ ______________
8181
Returns a new set with elements from the set and the specified iterables.
8282

8383
Set Operations Assignment
84-
_____________________________
84+
----
8585
`difference_update`_
8686
Updates the set, removing elements found in the specified iterables.
8787
`intersection_update`_
@@ -90,20 +90,20 @@ _____________________________
9090
Updates the set, keeping only elements found in either set or the specified iterable, but not in both.
9191

9292
Copying
93-
_______
93+
----
9494
`copy`_
9595
Returns a copy of the set.
9696

9797
Set Operators
98-
-------------
98+
====
9999

100100
Adding Elements
101-
_______________
101+
----
102102
`|= (update)`_
103103
Adds elements from another set.
104104

105105
Relational Operators
106-
____________________
106+
----
107107
`== (is equal)`_
108108
Returns a Boolean stating whether the set has the same elements as the other set.
109109
`!= (is not equal)`_
@@ -118,7 +118,7 @@ ____________________
118118
Returns a Boolean stating whether the set contains the other set and that the sets are not equal.
119119

120120
Set Operations
121-
______________
121+
----
122122
`- (difference)`_
123123
Returns a new set with elements in the set that are not in the other set.
124124
`& (intersection)`_
@@ -129,7 +129,7 @@ ______________
129129
Returns a new set with elements from the set and the other set.
130130

131131
Set Operations Assignment
132-
_________________________
132+
----
133133
`-= (difference_update)`_
134134
Updates the set, removing elements found in the other set.
135135
`&= (intersection_update)`_

0 commit comments

Comments
 (0)