This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def _set_y(instance, attribute, value): | |
object.__setattr_(instance, 'y', value) | |
# returning a value is important, otherwise attribute will become None | |
return value | |
@define | |
class MyClass: | |
x: str = field(on_settattr=[_set_y]) | |
y: str = field() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{{! Template according https://dorukkilitcioglu.com/2018/08/18/python-better-docstring.html }} | |
{{! Doruk Docstring Template }} | |
{{summaryPlaceholder}} | |
{{extendedSummaryPlaceholder}} | |
{{#argsExist}} | |
Args: | |
{{#args}} | |
{{&var}}::{{&typePlaceholder}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import secrets | |
from pony import orm | |
import uuid | |
database_settings = { | |
'host': 'localhost', | |
'user': 'ponyorm', | |
'password': 'ponyorm', | |
'database': 'ponyorm' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import string | |
import secrets | |
import peewee as pw | |
import uuid | |
database_settings = { | |
'host': 'localhost', | |
'user': 'peewee', | |
'password': 'peewee' | |
} |