Prothon Tutorial
Outline - Page 2
Prothon Home
Previous Page
Preface
Start Tutorial
6.
Prototype-based Programming
6.1 Making Your Own Object
obj = Object()
Object ID
Adding Attributes
Using With Statement
Object-centric Programming
Object Copying
Prototypes
Any Object Can Be A Proto
6.2 Parent Prototype Links
Disadvantages of Copying
Prototype Links
Attribute Searching
Special Object
Attribute Lookup Example
Inheritance
Efficiency
6.3 Object Statement
Example
Statement Format
6.4 Object Initialization
obj = Prototype(args)
Example of init_() Method
6.5 Sub-types
Narrowing a Category
Directed init_() Call
Explicit Self in Call
6.6 Changing Object Types
Changing Either Direction
Example
Reopening an Object
setProto() Function
str_() Method
6.7 Multiple Inheritance
Dangers of Multiple Inheritance
Example
7.
Local Scopes & Module Structure
7.1 Local Var Access & Scope Chain
Local Scope Object
Local Scope Chain
Blocks Create Scopes
No Python Global
Chain Ends at Object
7.2 Setting Local Vars & Outer Keyword
Shadowing Variables
Assignment Sets Scope
Outer Keyword
Closures
7.3 Caller Keyword
Caller Explained
Uses for Caller & Example
8.
Generators & Exceptions
8.1 Generators
Gen Keyword
Yield Keyword
Example
Nested Generators
Stackless Operation
Execution Frames
8.2 Exceptions
Raising an Exception
Exception Object
Try Except Keywords
Example
Raise Keyword
Prothon Home
Previous Page
Preface
Start Tutorial