Skip to content

This is some of the code I will be writing whilst working through "Fluent Python" by Luciano Ramalho

Notifications You must be signed in to change notification settings

capitao-red-beard/fluent_python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fluent Python Code Snippets

This repository contains code I am writing whilst going through Luciano Ramalho's "Fluent Python" book.

Part 1. Prologue

1. The Python Data Model

  • french_deck.py a Python class representing a french deck of cards, highlighting the power of Python.
  • vector.py a Python class representing a vector, implementation of special methods.

Part 2. Data Structures

2. An Array of Sequences

  • listcomps.py a Python code snippet used to visualise list comprehension in Python.
  • gen_exps.py a Python code snippet showing how to use generator expressions.
  • tuples_lists.py a Python code snippet demonstrating the uses of tuples and lists in Python.
  • arrays_queues.py a Python code snippet demonstrating when to use arrays and queues, and why in Python.

3. Dictionaries and Sets

  • dictionaries.py a Python code snipper used to show some of the features of dictionaries in Python.
  • sets.py a Python code snippet to show some of the features of the widely under used set type.

4. Text vs. Bytes

  • text_vs_bytes.py a Python code snippet to show the difference between text and bytes in Python.

Part 3. Functions as Objects

5. First-Class Functions

  • functions.py a Python code snippet to show Python treating functions as objects, everything in Python is an object.

6. Design Patterns with First-Class Functions

  • design_patterns.py a Python code snippet showing the design patters which can be used with first-class functions in Python.
  • design_patterns_2.py a Python code snippet showing the design patters which can be used with first-class functions in Python.

7. Function Decorators and Closures

  • decorators_101.py a Python code snippet showing the behaviour and usefulness of decorators in the Python language.
  • clockdeco_demo.py a Python code snippet shwoing an example of a decorator function in action.
  • clockdeco2.py a Python code snipper showing another default library decorator in action.

Part 4. Object-Oriented Idioms

8. Object References, Mutability, and Recycling

  • obj_ref_mut_recy.py a Python code snippet showing some of the contents covered in this chapter.

9. A Pythonic Object

  • vector2d_v0.py a Python class detailing Python objects using coded examples.
  • private_protected.py a Python code snippet showing protected and private variables in Python.

10. Sequence Hacking, Hashing, and Slicing

  • 10.py a Python code snippet showcasing "sequence hacking, hashing and slicing" in Python.

11. Interfaces: From Protocols to ABCs

  • interfaces_protocols.py a Python code snippet covering some of the topics of this chapter.

12. Inheritance: For Good or For Worse

  • inheritance.py a Python code snippet showing some of the inheritance features of Python.

13. Operator Overloading: Doing It Right

  • op_overloading.py A python code snippet highlighting some of the operator overloading concepts in Python.

Part 5. Control Flow

14. Iterables, Iterators, and Generators

  • sequences.py A Python code snippet detailing some of the iteration specificities of Python.

About

This is some of the code I will be writing whilst working through "Fluent Python" by Luciano Ramalho

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages