Index
A
- ad hoc polymorphism
- about / Polymorphism – a brief overview
- AJAX
- Anaconda
- anonymous functions
- about / Anonymous functions
- API
- testing / Testing the API
- helpers, testing / Testing the helpers
- handlers, testing / Testing the handlers
- application
- testing / Testing your application
- application programming interface (API)
- about / Writing a unit test
- assertion
- about / Assertions
B
- Base64
- about / The imports
- base class
- about / Inheritance and composition
- binary search
- about / Where to inspect
- Bitbucket
- URL / Exceptions
- black-box tests
- about / Testing your application
- Bokeh
- boundaries
- about / A specialized else: elif
- boundary
- about / Boundaries and granularity
- built-in exceptions hierarchy
- URL / Exceptions
- built-in functions
- about / Built-in functions
- built-in scope
- about / Scopes
- business logic, GUI application
- web page, fetching / The business logic, Fetching the web page
- images, saving / Saving the images
- user, alerting / Alerting the user
C
- callback
- about / The layout logic
- campaign
- about / Preparing the data
- classes
- class methods
- about / Class methods
- code
- writing, guidelines / Guidelines on how to write good code
- documenting / Documenting your code
- collections module
- about / The collections module
- named tuples / Named tuples
- defaultdict / Defaultdict
- ChainMap / ChainMap
- comma-separated values (CSV)
- about / Saving the DataFrame to a file
- command prompt
- composition
- about / Inheritance and composition
- comprehensions
- about / map, zip, and filter, Comprehensions
- nested comprehensions / Nested comprehensions
- filtering / Filtering a comprehension
- dict comprehensions / dict comprehensions
- set comprehensions / set comprehensions
- and generators / Don't overdo comprehensions and generators
- conditional programming
- about / Conditional programming
- elif / A specialized else: elif
- ternary operator / The ternary operator
- considerations
- threading / Threading considerations
- console
- constructor
- about / Initializing an instance
- container datatypes
- defining / The collections module
- context manager
- using / The business logic
- context object
- preparing / The template layer
- cookies
- about / How does the Web work?
- CPC (Cost Per Click)
- about / Unpacking the user data
- CPI (Cost Per Impression)
- about / Unpacking the user data
- Cron
- about / Running Python scripts
- Cross-origin resource sharing (CORS)
- about / Talking to the API
- cross-site request forgery (CSRF) attack
- about / Creating the form
- CSS (Cascading Style Sheets)
- about / A regex website
- CTR (Click Through Rate)
- about / Unpacking the user data
- custom exceptions
- writing / Exceptions
- custom iterator
- writing / Writing a custom iterator
- cypertext
- about / The model layer
D
- data
- dealing with / Dealing with data
- notebook, setting up / Setting up the notebook
- preparing / Preparing the data
- cleaning / Cleaning the data
- DataFrame, creating / Creating the DataFrame
- DataFrame, saving to file / Saving the DataFrame to a file
- results, visualizing / Visualizing the results
- DataFrame
- campaign name, unpacking / Unpacking the campaign name
- user data, unpacking / Unpacking the user data
- defining / Cleaning everything up
- data migrations
- about / Adding the Entry model
- data structures
- selecting / How to choose data structures
- debugging techniques
- about / Debugging techniques
- debugging, with print / Debugging with print
- debugging, with custom function / Debugging with a custom function
- traceback, inspecting / Inspecting the traceback
- Python debugger, using / Using the Python debugger
- log files, inspecting / Inspecting log files
- profiling / Profiling
- assertions / Assertions
- information, finding / Where to find information
- decorate-sort-undecorate
- decoration
- about / Decorators
- decoration point
- about / Decorators
- decorator
- about / Decorators
- decorator factory
- about / A decorator factory
- decorators
- about / Decorators
- default values
- determinist profiling
- about / Profiling Python
- diamond
- about / Multiple inheritance
- dictionaries
- about / Mapping types – dictionaries
- discounts
- applying / Example 2 – applying discounts
- dispatcher
- about / Example 2 – applying discounts
- Django
- setting up / Setting up Django
- URL / Setting up Django
- project, starting / Starting the project
- users, creating / Creating users
- about / Writing the templates
- Django interface
- implementing / Our implementation, Implementing the Django interface
- setup / The setup
- model layer / The model layer
- simple form / A simple form
- view layer / The view layer
- URLs, setting up / Setting up the URLs
- template layer / The template layer
- Django URL dispatcher
- defining / The Django URL dispatcher
- regular expression / Regular expressions
- Django web framework
- defining / The Django web framework
- model layer / The model layer
- view layer / The view layer
- template layer / The template layer
- docstrings
- about / Documenting your code
- DRY (Don't Repeat Yourself) principle / How do we use modules and packages
- dunder
- about / Going beyond next
E
- enclosing scope
- about / Scopes
- entries
- about / Starting the project
- environment
- setting up / Setting up the environment
- equalities
- about / A specialized else: elif
- Euclid's algorithm
- Euclidean formula
- exception
- about / A special else clause
- exceptions
- about / Exceptions
- execution model, Python
- about / Python's execution model
F
- factorial
- Falcon
- JSON quote server, building / Building a JSON quote server in Falcon
- about / Building a JSON quote server in Falcon
- URL / Building a JSON quote server in Falcon
- Falcon API
- implementing / Implementing the Falcon API
- main application / The main application
- helpers, writing / Writing the helpers
- handlers, writing / Writing the handlers
- API, running / Running the API
- API, testing / Testing the API
- features, Python
- portability / Portability
- coherence / Coherence
- developer productivity / Developer productivity
- extensive library / An extensive library
- software quality / Software quality
- software integration / Software integration
- satisfaction and enjoyment / Satisfaction and enjoyment
- Fibonacci sequence example
- about / One last example
- filter
- about / map, zip, and filter
- defining / filter
- Flask
- URL / Writing a Flask view
- about / Writing a Flask view
- Flask view
- writing / Writing a Flask view
- floating point numbers
- URL / Reals
- form
- about / Creating the form
- framework
- about / The Django web framework
- function
- function attributes
- about / Function attributes
- functions
- using / Why use functions?
- code duplication, reducing / Reduce code duplication
- complex task, splitting / Splitting a complex task
- implementation details, hiding / Hide implementation details
- readability, improving / Improve readability
- traceability, improving / Improve traceability
- writing, tips / A few useful tips
- example / One final example
G
- generation behavior, in built-ins
- about / Generation behavior in built-ins
- generator expressions
- about / Generator expressions
- generator functions
- about / Generator functions
- generator objects
- about / Going beyond next
- generators
- about / map, zip, and filter, Generators
- generator functions / Generators
- generator expressions / Generators
- and comprehensions / Don't overdo comprehensions and generators
- getter
- about / The property decorator
- getters and setters
- about / The property decorator
- Git
- GitHub
- URL / Exceptions
- global scope
- about / Scopes
- gray-box testing
- about / Testing your application
- greatest common divisor (GCD)
- Green phase
- about / Test-driven development
- GUI (Graphical User Interface) / Running Python as a GUI application
- GUI application
- Python, running as / Running Python as a GUI application
- about / Second approach – a GUI application
- imports / Second approach – a GUI application, The imports
- layout logic / The layout logic
- business logic / The business logic
- improving / How to improve the application?
- Gunicorn
- URL / Running the API
- Gunicorn (Green Unicorn)
H
- handlers
- writing / Writing the handlers
- password validator handler, coding / Coding the password validator handler
- password generator handler, coding / Coding the password generator handler
- Hashability
- about / Set types
- helpers
- writing / Writing the helpers
- password validator, coding / Coding the password validator
- password generator, coding / Coding the password generator
- HTML Document Object Model (DOM)
- about / Creating the form
- Hypertext Markup Language (HTML)
- about / The view layer
- Hypertext Transfer Protocol (HTTP)
- about / What is the Web?
I
- IDLE (Integrated DeveLopment Environment) / Running the Python interactive shell
- immutable
- immutable sequences
- about / Immutable sequences
- strings and bytes / Strings and bytes
- tuples / Tuples
- implicit concatenation
- in-place
- about / Unpacking the user data
- indexing
- about / About indexing and slicing
- inequalities
- about / A specialized else: elif
- infinite loop
- about / The while loop
- inheritance
- about / Inheritance and composition
- initializer
- inner
- about / A specialized else: elif
- input parameters
- about / Input parameters
- argument passing / Argument passing
- assignment, to argument names / Assignment to argument names don't affect the caller
- mutable, changing / Changing a mutable affects the caller
- specifying / How to specify input parameters
- positional arguments / Positional arguments
- keyword arguments / Keyword arguments and default values
- default values / Keyword arguments and default values
- variable positional arguments / Variable positional arguments
- variable keyword arguments / Variable keyword arguments
- keyword-only arguments / Keyword-only arguments
- , combining / Combining input parameters
- mutable defaults / Avoid the trap! Mutable defaults
- inside-out technique
- about / Iterating over a sequence
- installing
- Python / Installing Python
- instance attributes
- about / Class and object namespaces
- instances of classes
- about / Object and classes
- integer division (//)
- about / Integers
- Integrated Development Environments (IDEs) / A note on the IDEs
- about / The property decorator
- interface testing
- about / Interface testing
- Internet
- about / What is the Web?
- ipdb library
- about / Using the Python debugger
- IPython
- Ipython
- about / IPython and Jupyter notebook
- URL / IPython and Jupyter notebook
- iterable
- about / Writing a custom iterator
- iterator
- itertools module
- about / A quick peek at the itertools module
- infinite iterators / Infinite iterators
- terminating, on shortest input sequence / Iterators terminating on the shortest input sequence
- combinatoric generators / Combinatoric generators
J
- jQuery
- about / The template layer
- URL / The template layer
- JSON (JavaScript Object Notation)
- about / Exceptions
- JSON quote server
- building, in Falcon / Building a JSON quote server in Falcon
- Jupyter notebook
- about / IPython and Jupyter notebook
- URL / IPython and Jupyter notebook
K
- KeepassX
- about / The challenge
- keyword-only parameter
- about / Keyword-only arguments
- keyword arguments
L
- lambdas
- about / Anonymous functions
- library
- list comprehension
- about / Lists
- local, enclosing, global, built-in (LEGB) / Scopes
- local scope
- about / Scopes
- log files
- about / Inspecting log files
- loggers / Inspecting log files
- handlers / Inspecting log files
- filters / Inspecting log files
- formatters / Inspecting log files
- logging
- URL / Inspecting log files
- loop
- iterating, over range / Iterating over a range
- iterating, over sequence / Iterating over a sequence
- looping
- about / Looping
- for loop / The for loop
- iterators and iterables / Iterators and iterables
- iterating, over multiple sequences / Iterating over multiple sequences
- while loop / The while loop
- break and continue statements / The break and continue statements
- else clause / A special else clause
M
- magic method
- about / Object and classes
- magic methods
- about / Going beyond next
- map
- about / map, zip, and filter
- defining / map
- markdown
- about / IPython and Jupyter notebook
- master password
- about / The challenge
- Matplotlib
- Mercurial
- merge and insertion sort
- about / Lists
- metaclasses
- metaprogramming
- about / The simplest Python class
- method
- about / Going beyond next
- method resolution order (MRO)
- about / Method resolution order
- methods
- about / A proper introduction
- middleware class
- about / Writing the templates
- migration
- about / Adding the Entry model
- migrations
- applying / Starting the project
- mixins
- about / Multiple inheritance
- mocks
- about / Mock objects and patching
- model
- about / The model layer
- model-template-view (MTV) pattern
- about / Django design philosophy
- model-view-controller (MVC)
- about / Django design philosophy
- modules
- mutable
- mutable sequences
- about / Mutable sequences
- lists / Lists
- byte arrays / Byte arrays
N
- NameError exception / Scopes
- name localization
- about / Name localization
- name mangling
- names
- about / Names and namespaces
- defining / About the names
- namespaces
- about / Names and namespaces
- nano
- about / Using console editors
- negative indexing
- about / About indexing and slicing
- nose-parameterized
- Numba
- numbers
- about / Numbers
- integers / Integers
- booleans / Booleans
- real numbers / Reals
- complex numbers / Complex numbers
- fractions and decimals / Fractions and decimals
- Numeric Python
- about / Creating the DataFrame
- NumPy
O
- object
- defining / Everything is an object
- mutable / Mutable or immutable? That is the question
- immutable / Mutable or immutable? That is the question
- object-oriented programming
- about / Object-oriented programming
- Python class / The simplest Python class
- class and object namespaces / Class and object namespaces
- attribute shadowing / Attribute shadowing
- self variable, using / I, me, and myself – using the self variable
- instance, initializing / Initializing an instance
- code, reusing / OOP is about code reuse
- inheritance and composition / Inheritance and composition
- base class, accessing / Accessing a base class
- multiple inheritance / Multiple inheritance
- method resolution order / Method resolution order
- class and static methods / Static and class methods
- private methods / Private methods and name mangling
- name mangling / Private methods and name mangling
- property decorator / The property decorator
- operator overloading / Operator overloading
- polymorphism / Polymorphism – a brief overview
- object-relational mapping (ORM)
- about / The model layer
- objects
- about / A proper introduction, Object and classes, Object-oriented programming
- importing / Importing objects
- relative imports / Relative imports
- one way encryption algorithm
- about / The model layer
- one way hash function
- about / The model layer
- operating system (OS)
- about / Portability
- operator overloading
- about / Lists, Operator overloading
- outer
- about / A specialized else: elif
P
- package
- about / How is Python code organized
- packages
- Pandas
- patching
- about / Mock objects and patching
- URL / A classic unit test example
- pdb
- about / Using the Python debugger
- PEP328
- about / Relative imports
- performance considerations
- about / Some performance considerations
- pivot table
- about / Visualizing the results
- plaintext
- about / The model layer
- polymorphism / Polymorphism – a brief overview
- primary key
- about / The model layer, Adding the Entry model
- prime generator
- about / Example 1 – a prime generator
- primitive
- principle of least astonishment
- principles, Django web framework
- DRY / Django design philosophy
- Loose coupling / Django design philosophy
- Less code / Django design philosophy
- Consistency / Django design philosophy
- profiling
- about / Exceptions, When to profile?
- properties
- about / A proper introduction
- protocols
- about / What is the Web?
- pull protocol
- about / How does the Web work?
- push protocol
- about / How does the Web work?
- PyGTK
- PyPy
- URL / What are the drawbacks?
- PyQt
- pytest
- Pythagorean triple
- about / Filtering a comprehension
- Python
- about / Enter the Python
- features / About Python, Software integration
- drawbacks / What are the drawbacks?
- users / Who is using Python today?
- installing / Installing Python
- references / Setting up the Python interpreter
- running, as service / Running Python as a service
- running, as GUI application / Running Python as a GUI application
- execution model / Python's execution model
- profiling / Profiling Python
- Python 2
- versus Python 3 / Python 2 versus Python 3 – the great debate
- Python code
- organizing / How is Python code organized
- Python culture
- about / The Python culture
- Python Enhancement Proposal (PEP) / Guidelines on how to write good code
- Python interactive shell
- running / Running the Python interactive shell
- Python interpreter
- setting up / Setting up the Python interpreter
- Python module
- reference / Everything is an object
- Python Package Index (PyPI) / An extensive library
- Python program
- running / How you can run a Python program
- Python scripts
- running / Running Python scripts
Q
- quality assurance (QA)
- about / Testing your application
R
- radix-64
- about / The imports
- recursive functions
- about / Recursive functions
- Red phase
- about / Test-driven development
- Refactor
- about / Test-driven development
- regex website
- defining / A regex website
- Django, setting up / Setting up Django
- Entry model, adding / Adding the Entry model
- admin panel, customizing / Customizing the admin panel
- form, creating / Creating the form
- views, writing / Writing the views
- URLs and views, using / Tying up URLs and views
- templates, writing / Writing the templates
- regular expression / Regular expressions
- relational database
- about / The model layer
- relative imports
- URL / Relative imports
- request-response client-server protocol
- about / How does the Web work?
- return values
- about / Return values
- multiple values, returning / Returning multiple values
S
- scheduler
- about / Threading considerations
- schema migration
- about / Adding the Entry model
- Schwartzian transform
- about / map
- Scikit-Learn
- SciPy
- scopes
- scopes and name resolution
- defining / Scopes and name resolution
- global and nonlocal statements / The global and nonlocal statements
- scripting
- about / First approach – scripting
- imports / First approach – scripting, The imports
- arguments, parsing / Parsing arguments
- business logic / The business logic
- service
- Python, running as / Running Python as a service
- service-oriented architecture (SOA)
- about / Inspecting log files
- service-oriented architectures
- about / Inspecting log files
- setter
- about / The property decorator
- set types
- about / Set types
- Single-Page Application (SPA)
- about / The future of web development
- Single Responsibility Principle (SRP)
- about / Writing the helpers
- slicing
- about / About indexing and slicing
- small values caching
- about / Small values caching
- space
- about / Some performance considerations
- Sphinx
- about / Documenting your code
- SQL (Structured Query Language)
- about / The model layer
- static methods
- about / Static methods
- statistical profiling
- about / Profiling Python
- strings
- encoding / Encoding and decoding strings
- decoding / Encoding and decoding strings
- indexing / Indexing and slicing strings
- slicing / Indexing and slicing strings
- str objects
- about / Strings and bytes
- symmetric encryption algorithm
- about / The model layer
- system-exiting exceptions
- about / Exceptions
T
- Tcl (Tool Command Language) / Running Python as a GUI application
- TCP/IP (Transmission Control Protocol/Internet Protocol)
- about / How does the Web work?
- template layer
- about / The template layer
- home and footer templates / Home and footer templates
- records, listing / Listing all records
- records, creating / Creating and editing records
- records, editing / Creating and editing records
- API, defining / Talking to the API
- records, deleting / Deleting records
- terminal
- ternary operator
- about / The ternary operator
- test
- defining / The anatomy of a test
- preparation / The anatomy of a test
- execution / The anatomy of a test
- verification / The anatomy of a test
- failing / Making a test fail
- test-driven development (TDD)
- about / Test-driven development
- benefits / Test-driven development
- disadvantages / Test-driven development
- testing guidelines
- defining / Testing guidelines
- tests
- front-end tests / Testing your application
- scenario tests / Testing your application
- integration tests / Testing your application
- smoke tests / Testing your application
- Acceptance tests / Testing your application
- functional tests / Testing your application
- destructive tests / Testing your application
- performance tests / Testing your application
- usability tests / Testing your application
- security and penetration tests / Testing your application
- unit tests / Testing your application
- regression tests / Testing your application
- comparing, with mocks / Comparing tests with and without mocks
- comparing, without mocks / Comparing tests with and without mocks
- boundaries / Boundaries and granularity
- granularity / Boundaries and granularity
- example / A more interesting example
- thread
- about / Threading considerations
- time
- about / Some performance considerations
- Timsort
- about / Lists
- Tk / Running Python as a GUI application
- tkinter
- Tkinter / Running Python as a GUI application
- tkinter.tix (Tk Interface Extension) module
- about / The tkinter.tix module
- tkinter.tix module
- about / The tkinter.tix module
- Tk interface
- triangulation
- troubleshooting guidelines
- about / Troubleshooting guidelines
- console editors, using / Using console editors
- inspecting / Where to inspect
- tests used, for debugging / Using tests to debug
- monitoring / Monitoring
- true division (/)
- about / Integers
- tuple
- about / Tuples
- turtle module
- about / The turtle module
U
- unicode code points
- about / Strings and bytes
- Uniform Resource Locator (URL)
- about / The Django URL dispatcher
- unit test
- about / Unit testing
- writing / Writing a unit test
- mock objects / Mock objects and patching
- patching / Mock objects and patching
- assertions / Assertions
- example / A classic unit test example
- unit testing
- defining / Unit testing
- unpacking
- about / Variable positional arguments
- Upcasting
- about / Booleans
- user acceptance testing (UAT)
- about / Testing your application
- user experience (UX)
- about / Testing your application
- Utf-8
- about / Encoding and decoding strings
V
- view layer
- about / The view layer
- imports and home view / Imports and home view
- records, listing / Listing all records
- records, creating / Creating records
- records, updating / Updating records
- records, deleting / Deleting records
- views
- writing / Writing the views
- home view / The home view
- entry list view / The entry list view
- form view / The form view
- vim
- about / Using console editors
- virtualenv
- about / About virtualenv
- reference link / About virtualenv
- virtual environment
- creating / Your first virtual environment
W
- wasted time
- about / About the names
- Web (World Wide Web)
- defining / What is the Web?
- working / How does the Web work?
- web development
- defining / The future of web development
- web framework
- about / The Django web framework
- white-box tests
- about / Testing your application
- wxPython
Y
- yield from expression
- about / The yield from expression
Z
- zip
- about / map, zip, and filter
- defining / zip