Skip to content

Commit

Permalink
some updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jprzywoski committed Jun 3, 2015
1 parent 95a0b93 commit a9453ee
Show file tree
Hide file tree
Showing 13 changed files with 374 additions and 91 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Welcome to the Python Reference (the Right Way) repository.

Date: Tue Jan 27 2015

This repository contains all of the source documents that are used to generate
This repository contains all of the source files that are used to generate
the above documentation.

Email Jakub Przywóski <jprzywoski@tlen.pl> with questions or comments.
Email Jakub Przywóski <jprzywoski@tlen.pl> with questions or comments.
8 changes: 4 additions & 4 deletions source/docs/bytearray/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ An example of a bytearray length 4.


Constructors
------------
====
`bytearray()`_
Returns a new bytearray object.

Methods
----
====
`fromhex`_
Returns a new bytearray object initialized from a string of hex numbers.

`Methods Inherited From str`_
----
====

`Methods Inherited From list`_
----
====

.. _bytearray(): ../functions/bytearray.html
.. _fromhex: fromhex.html
Expand Down
14 changes: 5 additions & 9 deletions source/docs/complex/index.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
=======
====
complex
=======
====

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.

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

Constructors
------------
====
`complex()`_
Returns an expression converted into a complex number.
`Literal Syntax`_

Properties
----------
====
`real`_
Retrieves the real component of this number.
`imag`_
Retrieves the imaginary component of this number.

Methods
-------
====
`conjugate`_
Returns the complex conjugate.

Expand All @@ -29,7 +29,3 @@ Methods
.. _real: real.html
.. _imag: imag.html
.. _conjugate: conjugate.html




10 changes: 5 additions & 5 deletions source/docs/float/index.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
=====
====
float
=====
====

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.

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.

Constructors
------------
====
`float()`_
Returns an expression converted into a floating point number.
`Literal Syntax`_

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

Methods
-------
====
`as_integer_ratio`_
Returns a pair of integers whose ratio is exactly equal to the original float and with a positive denominator.
`is_integer`_
Expand Down
11 changes: 6 additions & 5 deletions source/docs/ints/index.rst
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
===
====
int
===
====

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).

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.

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!).

Constructors
------------
====
`int()`_
Returns an expression converted into an integer number.
`int Literal Syntax`_

Base Designators
----------------
====
`0... (Base Designators)`_
Returns a decimal integer converted from the specified base.

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

Expand Down
6 changes: 3 additions & 3 deletions source/docs/ints/indexl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ long
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.

Constructors
------------
====
`long()`_
Returns an expression converted into a long integer number.
`long Literal Syntax`_

Base Designators
----------------
====
`0... (Base Designators)`_
Returns a decimal integer converted from the specified base.

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

Expand Down
27 changes: 17 additions & 10 deletions source/docs/list/index.rst
Original file line number Diff line number Diff line change
@@ -1,23 +1,27 @@
====
list
====

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.)
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.)

Constructors
============
====
`list()`_
Converts an object into a list.
`[] list comprehensions`_
Returns a list based on existing iterables.
`literal syntax`_

Misc
Initializes a new instance of the **list** type.

Operators
====
`[] (index operator)`_
Gives access to a sequence's element.
`[::] (slicing)`_
Gives access to a specified range of sequence's elements.
`+ (concatenation)`_
Returns a concatenation of two sequences.
`* (multiple concatenation)`_
Returns a sequence self-concatenated specified amount of times.

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

Methods
=======
====

Adding Elements
_______________
----
`insert`_
Inserts an item at a given position.
`append`_
Expand All @@ -55,14 +61,14 @@ _______________
Extends the list by appending all the items from the iterable.

Deleting
________
----
`remove`_
Removes the first item from the list which matches the specified value.
`pop`_
Removes and returns the item at the specified index.

Information
___________
----
`index`_
Returns the index of the first occurrence of the specified list item.
`count`_
Expand All @@ -80,7 +86,6 @@ ___________
.. _remove: remove.html
.. _index: lindex.html
.. _count: count.html

.. _enumerate: ../functions/enumerate.html
.. _len: ../functions/len.html
.. _reversed: ../functions/reversed.html
Expand All @@ -92,3 +97,5 @@ ___________
.. _min: ../functions/min.html
.. _all: ../functions/all.html
.. _any: ../functions/any.html
.. _+ (concatenation): ../operators/concatenation.html
.. _* (multiple concatenation): ../operators/multiple_concatenation.html
6 changes: 3 additions & 3 deletions source/docs/memoryview/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ memoryview


Constructors
------------
====
`memoryview()`_
Returns a new memoryview object.

Methods
----
====
`tobytes`_
Returns the data in the buffer as a string.
`tolist`_
Returns the data in the buffer as a list of integers.

Properties
----
====
`format`_
Returns a string containing the format (in struct module style) for each element in the view.
`itemsize`_
Expand Down
26 changes: 13 additions & 13 deletions source/docs/sets/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Sets do not record element position or order of insertion. Accordingly, sets do
Sets are implemented using dictionaries. They cannot contain mutable elements such as lists or dictionaries. However, they can contain immutable collections.

Constructors
------------
====
`set()`_
Returns a set type initialized from iterable.
`{} set comprehension`_
Expand Down Expand Up @@ -40,17 +40,17 @@ Functions
Returns a list of tuples, where the i-th tuple contains the i-th element from each of the argument sequences or iterables.

Methods
-------
====

Adding Elements
_______________
----
`add`_
Adds a specified element to the set.
`update`_
Adds specified elements to the set.

Deleting
________
----
`discard`_
Removes an element from the set.
`remove`_
Expand All @@ -61,7 +61,7 @@ ________
Removes all elements from the set.

Information
___________
----
`issuperset`_
Returns a Boolean stating whether the set contains the specified set or iterable.
`issubset`_
Expand All @@ -70,7 +70,7 @@ ___________
Returns a Boolean stating whether the set contents do not overlap with the specified set or iterable.

Set Operations
______________
----
`difference`_
Returns a new set with elements in the set that are not in the specified iterables.
`intersection`_
Expand All @@ -81,7 +81,7 @@ ______________
Returns a new set with elements from the set and the specified iterables.

Set Operations Assignment
_____________________________
----
`difference_update`_
Updates the set, removing elements found in the specified iterables.
`intersection_update`_
Expand All @@ -90,20 +90,20 @@ _____________________________
Updates the set, keeping only elements found in either set or the specified iterable, but not in both.

Copying
_______
----
`copy`_
Returns a copy of the set.

Set Operators
-------------
====

Adding Elements
_______________
----
`|= (update)`_
Adds elements from another set.

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

Set Operations
______________
----
`- (difference)`_
Returns a new set with elements in the set that are not in the other set.
`& (intersection)`_
Expand All @@ -129,7 +129,7 @@ ______________
Returns a new set with elements from the set and the other set.

Set Operations Assignment
_________________________
----
`-= (difference_update)`_
Updates the set, removing elements found in the other set.
`&= (intersection_update)`_
Expand Down

0 comments on commit a9453ee

Please sign in to comment.