Don't reinvent Sandwich. (Decorator and with statement)

  • R2
  • Day 1, 16:10‑16:55
  • Chinese talk w. English slides
  • Best Practices & Patterns
  • Novice

Content:
1. Concept of reuse "sandwich"
2. decorator
2.1 Quick introduction
2.2 How decorator save you from repeat in yourself
2.3 Example
3. with statement
3.1 Quick introduction
3.2 How with statement save you from repeat in yourself
3.3 Example

Talk Detail

Python use 'def' to make a subroutine, which could separate the work, make the code more clear and most important: we could reuse them. Python Decorator and "with" statement could also do the same thing but in another way. Just like the bread of the sandwich which wrap the stuffing. Could we reuse this "sandwich bread" to make our code clear and easier??? The goal is to let target audiences has a new angle of view to these two python basic syntax. Quick introduction on basic syntax will be included.

Speaker Information

蕭聖穎 (Stanley Hsiao)

Use python from 2005.
IC designer who want to benefit the world.