python_pyqt
Table des matières
Python
Data Types and Data Structures
Variables and Objects
- Dynamic Typing
variables
are Object references
<note important>
function
subroutine executed independandly
method
function bound to an instance of an object
operator
function bound or not to instance, do not use parenthesis and part
</note>
- comparison opérator
==
,<
… ⇒ Value comparison is
operator ⇒ identity comparison (identify of an object can be retriece byobject.id()
)None
special null object (singleton)
<note tip>
Python keywords
and class elif finally if lambda print while as continue else for import not raise with
assert def except from in or return yield break del exec global is pass try
</note>
Numbers and Strings
- all basic types are immutable
Integers and Long Integers
bool
: boolean with two valuesFalse
andTrue
- In integer context
False
is evaluated to 0 ,True
is evaluted to 1
int
: classical machine related integer- operation with
int
exceeding theint
range is converted intolong' *
long: integer which size is the machine memory * use suffix
Lto signify a
longvalue * numbers are by default written in base 10 * Python assume that any value with prefix
0xis written in hexadecimal, octol for value starting with 0 * classical operators
+ - / % += -= /= %=, '**' for power , '' for truncated division * '
is
Float and Decimal
- float: double-precision floating-point numbers whose range depends on the C (or Java) compiler computed in base 2
- Decimal
- complex
String TYpes
python_pyqt.txt · Dernière modification : 2016/10/20 13:01 de francois