Title: Theory / Important / CS / Programming / Python / Fluent{ / intro
Tags: récupéré seen_description FromInstruction automatedNewLineAfterCommaSpace computer_to_instruction examplesSwitchExample1 hasNotNewEffectReturnsMeaning

Question: Best features of python
Answer: consistency
Page: 3
Chapter: 1

Definition: Special python name
Page: 3
Chapter: 1
Example: __getitem__
Representation: begin and ends with __

Name: dunder foo
Page: 4
Chapter: 1
Notation: __foo__

Instruction: foo.__len__()
Page: 5
Effect: The number of elements in the set foo
Language: Python
Chapter: 1
Abbreviation: len(foo)
Typ: non-negative integral number

Instruction: +ELLISPSIS
Page: 7
Effect: replace too long output by ellipsis
Language: Python
Context: doctest
Chapter: 1

Instruction: sorted(foo)
Page: 7
Language: Python
Context: doctest
Chapter: 1
Returns: A set of elements of foo sorted

Instruction: sorted(
  foo,
  key=bar
)
Page: 7
Effect: A set of elements of foo sorted according to the function bar
Language: Python
Context: doctest
Chapter: 1

Question: How len works
Answer: For basic type, by calling an underlying C function. For object, by calling .__len__
Page: 8
Chapter: 1
Context: doctest

Question: Why to avoid variable/attribute with name __foo__ where foo is not a magical name
Answer: it may become one later
Page: 9
Chapter: 1

Instruction: foo.__bool__()
Page: 12
Effect: A function, returning true or false, allowing to know the truth value of foo
Language: Python
Chapter: 1
Abbreviation: bool(foo)

Question: What is the truth value of an instance of user-defined class
Answer: bool(foo) if it exists.
Page: 12
Chapter: 1
Answer2: Otherwise len(foo) if it exists,
Answer3: otherwise True

Instruction: x or y
Page: 12
Effect: x if its truthy, else y
Language: Python
Chapter: 1

Instruction: x and y
Page: 12
Effect: x if its falsy, else y
Language: Python
Chapter: 1

Name: Reversed operator
Definition: An operator used as fallback when operands are swapped
Page: 14
Chapter: 1

Instruction: foo.count(bar)
Page: 14
Effect: The number of bar in the sequence foo
Language: Python
Chapter: 1