Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Advanced Python With VM Internals
Rating: 3.7 out of 5(20 ratings)
151 students

Advanced Python With VM Internals

Learn Advanced Python with Virtual Machine Insights
Created byVivek Saxena
Last updated 9/2016
English
English [Auto],

What you'll learn

  • Start contributing to live commercial Python project within 1-2 days
  • System level knowledge of Classes Functions Closures and Decorators
  • Implement Python design patterns and make effective use of Python Decorators. This course is mandatory to be able to do a code walkthrough of commercial Python softwares like Open Stack

Course content

1 section14 lectures2h 9m total length
  • Introduction2:49
  • Python Data Model10:13
    1. Python Data Model
    2. Objects 
    3. References
    4. "is" Operator
    5. "type" , "id" Operators
    6. Copy and Assignment
    7. Module "Copy"
    8. Equality and Comparison
    9. Value, Identity, Memory
    10. Types
  • Functions9:21
    1. Functions in Virtual Machine
    2. Function Environment
    3. Function Header
      1. Positional Arguments
      2. Variable arguments list
      3. Default arguments
      4. Key Word Only arguments
      5. Dictionary Arguments
      6. Variable key-value pairs list
    4. Function Call


  • Closures9:54

    Function Closures

    • What is a closure
    • How closures relate to functions
    • Internals of a Closure
    • State Retention using closures
    • global and non-local keywords
    • Understand "Functions", "Stack Frame", "Code" and "Byte Code" relationship and related VM structures
  • Python Classes -- Part One12:13

    This section covers

    • Python Classes introduction
    • Difference and commonalities between Python Classes and C++ classes
    • Class statement and equivalent "type" statement
    • "type"object as metaclass of all python types
    • Meta Classes : __metaclass__ attribute
    • Write your own meta class
    • __new__ , __init__ , __call__
    • Classes as a callable
    • Instances are a callable too
    • Two step instance construction : Creation and Initialization
    • Singleton class using a Meta Class
    • Special Methods : "Static Methods" , "Class Methods" , "Instance Methods"
    • Class attributes and Methods
    • Instance Attributes
    • Inheritance
    • Multiple Inheritance : Diamond Structure


  • Python Classes -- Part Two15:10
    • Attributes and Function Lookup : Python 2 and Python 3
    • Method Overriding : Built Methods and User defined Methods overriding
    • Class internals while inheriting
    • Class dictionary and Instance dictionary
  • Iterators and List Comprehensions9:14
    1. What is an Iterator
    2. Iterator Protocol
    3. Write your own Iterator
    4. Iterators and Iterable
    5. "in" Operator and Iterator


  • Generators8:32
    1. What is a Generator Function
    2. Generator Function and Generator Object
    3. Iterator and Generator relationship


  • Generator Expressions & List Comprehension and Comprison9:15
    1. Generator Expression
    2. List Comprehension and Generator Expression
    3. Syntax and Operation
    4. Similarities and Differences
    5. Compare Generator and LC Byte Codes disassembly
    6. Performance Comparison : Memory, Code


  • Decorators -- Part One19:16

    This course is a single lecture and covers the following

    • What is a Decorator
    • Types of Decorator
    • The Decorator and the Decorated Callables
    • Function Decorators
    • Class Decorators
    • Method Decorators
    • Decorator with Parameters
    • Implementing function call logging using decorator
    • Implementing Singleton using Decorator
    • Implementing "Private and Public attributes" in a Python Class
  • Decorators -- Part Two11:18
  • Exception Handling Introduction and Demo4:01
    1. try-except
    2. try-except-else
    3. try-except-else-finaly
    4. Your Own Exception Class
    5. Variable Scope
    6. Order of Except block evaluation
  • Exception Handling -22:25

    Explore how derived exceptions are caught by the first matching except block, understand variable scope within each block, and handle unforeseen errors with a catch-all clause.

  • Exception Handling -- Polymorphic Exceptions5:31

Requirements

  • Practice a little bit writing simples python code on interactive shell

Description


A course on Python is useless if it doesn't answer following questions.
1. Why is Python slow 
2. How do you add more functionality to standard Python sdk
3. How do you sell propreity software written in Python and still keep it propreity.
4. How do you integrate your Python source code with your code written in other languages.

This course answers all these questions plus lot more

I am sure Meta Class may sound confusing and even scary to the best of us. Decorators look mysterious and intimidating. But before you start learning them you have to recall the first principal of Python language design and which is simplicity . Apart from that while designing Python lots of focus is given to readability and avoidance of complicated things. Python is simple (All chapters) readable, explicit and may be a bit complex but never complicated. Keeping these things in mind you have to approach learning Python because an over kill can confuse you needlessly. After keeping these things in mind only I created these lectures and have arranged subtopics that you come to know first things first, in correct order, clear and never take too long.

This course is to be taken after you are familiar with basics like data model, data types, loops and controls and you are a able to write small pieces of code. You have to be aware of and in practice of using Python Interactive Shell. You also have to know modules and how do we use them in various ways, be familiar with directives like import, import..from , import..from..as etc.

I have also used disassembler for demonstrating the Python byte code in action but it is not necessary to know them in depth and in advance.

Who this course is for:

  • You must take this course if you intend to work on opens stack or are about to embark on learning open stack
  • You want to be able to write test automation code without repeating any percentage of code
  • You want to implement design patterns in more than one ways, other than you have been already doing