This is supportive material for my talk Closures in Python
presented at PyCon SK 2017 in Bratislava, Slovakia.
Watch now on youtube:
The aim of talk was to introduce closures concent in general to the audience.
Presentation includes examples also from other languages like Java, C# or Javascript.
Check out pycon2017-closures.pdf
in root folder.
python
- contains examples in pythonjs
- contains examples in javascript / node.jscsharp
- contains examples in C#, .NET (Core)java
- contains examples in Java 8
- Introduction, Bottom-Up explanation
- Pool - usage of python, java, c#, javascript
- Question - example with list of functions (10,10,10...10)
- Scopes (local vs global variables)
- Functions as first class citizen
- Lambdas
- Classes (vs Functions)
- Simple example of closure
- Where is closed variable stored, GC discussion
- More closures examples (counter, average)
- Closures with functions
- Decorators, combined decorators
- Closures vs Classes
- Answer to initial question
- Answer in C#, Java
- Answer in Javascript
- Q&A
In case of questions do not hesitate to contact me. Feel free to send patch or pull request.