Nov-13-2018, 10:19 AM
Nov-13-2018, 11:08 AM
Many patterns are not used in Python, because of the good features in the language itself.
On the other side, we're using some patterns everyday without knowing it.
In other languages this design patterns are very important. For example in Java you need for everything getters and setters.
In Python we can make properties. The getter and setter pattern is not pythonic.
Example:
The use of design patterns is, that you can name a thing.
The source of design patterns came from an architect.
If you want to read a book about design patterns: https://www.packtpub.com/application-dev...n-patterns
But there is more material available.
On the other side, we're using some patterns everyday without knowing it.
In other languages this design patterns are very important. For example in Java you need for everything getters and setters.
In Python we can make properties. The getter and setter pattern is not pythonic.
Example:
Instead of this:
We do often this:
pizza_ofen.set_temp(100)
We do often this:
pizza_ofen.temp = 100
The source of design patterns came from an architect.
If you want to read a book about design patterns: https://www.packtpub.com/application-dev...n-patterns
But there is more material available.
Nov-13-2018, 01:31 PM
As mention bye @DeaD_EyE many patterns get used in Python without of thinking of it or talking about it.
@Brandon Rhodes Python Patterns has good write up about this.
You see stuff like this when talking about verdict/usage of pattern in Python.
@Brandon Rhodes Python Patterns has good write up about this.
You see stuff like this when talking about verdict/usage of pattern in Python.
Quote:The “Factory Method” pattern is a poor fit for Python.
It was designed for underpowered programming languages where classes and functions can’t be passed as parameters or stored as attributes.
In those languages, the Factory Method serves as an awkward but necessary escape route.
But it’s not a good design for Python applications
Nov-20-2018, 01:45 PM
By the way, you should subscribe here: https://www.pythonweekly.com/
Issue 342: https://pycoders.com/issues/342
There is one link to: https://python-patterns.guide/
Issue 342: https://pycoders.com/issues/342
There is one link to: https://python-patterns.guide/