Мне вообще никто не нужен, сам себе погрею ужин. Самодостаточная Data

Привет, на связи Лука. Мне всегда было интересно узнать больше о чистой архитектуре и о том, как построить систему, которая будет простой, но при этом выполнять всё, что от неё требуется. Естественно, без ухода в крайности, результат — наше всё, в булочную на такси не поедем. Со временем вырисовываются какие-то паттерны и принципы, к которым лежит душа. У каждого свои: кто-то горит TDD, кто-то ATDD, FDD, BDD и прочими DD. Я же больше всего прикипел к DDD, причём первая D тут варьируется: угораю как по Domain , так и по Data . И что дальше?

https://habr.com/ru/articles/889294/

#php #dataclass #данные_приложения #specification

Мне вообще никто не нужен, сам себе погрею ужин. Самодостаточная Data

Привет, на связи Лука. Мне всегда было интересно узнать больше о чистой архитектуре и о том, как построить систему, которая будет простой, но при этом выполнять всё, что от неё требуется. Естественно,...

Хабр

Атрибут или Dunder-метод slots в Python. Что нужно о нём знать?

Всем привет! Меня зовут Дима. Я являюсь Backend Python Developer'ом. Сегодня расскажу Вам про «волшебный» инструмент __slots__ в Python.

https://habr.com/ru/articles/884052/

#python #slots #__slots__ #dunder #dunder_methods #class #dataclass

Атрибут или Dunder-метод slots в Python. Что нужно о нём знать?

Всем привет! Меня зовут Дима. Я являюсь Backend Python Developer'ом. Сегодня расскажу Вам про «волшебный» инструмент __slots__ в Python. Оглавление Что такое слоты? Когда лучше использовать? Когда...

Хабр

How do you generate JSON schemas of your dataclasses' **inputs**? Any third-party library (something else than stdlib's dataclasses) allowing one to do that?

For example, input type is `int | str`, but final/output type is always `int` (coerced). I want to document the input type, not the output type.

#python #pydantic #dataclass #attrs #jsonschema

Function Properties in Data Classes are Code Smells

To me, using functions as properties in the primary constructor of a data class is a code smell. Here’s why: Data classes represent data. Data is a value. Data is never executed. Functions are not data. They produce values when executed. Note: By the book, a function returns a value, while a procedure executes commands. In both cases, neither is data. Why It Matters Kotlin generates key methods for data classes based on the properties in the primary constructor, such as:

Simpler Python YAML

YouTube
Dataclasses simplify the creation of classes for storing data by reducing boilerplate code. They provide automatic generation of __init__, __repr__ and other useful methods. #python #dataclasses #dataclass
A simple use case of werkzeug.routing.rules and dataclass is defining URL endpoints with associated parameters in a Python web application. #python #werkzeug #dataclass

Trying to use Data.define in ruby
I'd like to add some invariant checking on initialize and field content normalization (striping field content, ensure it's a string)...

Does someone already used it at scale ? Is there a performance issue from hash/keyword transformations ?

#ruby #dataclass ?

Introduction to Data Classes in Python3 - A Convenient Way to Store and Manipulate Data

Data classes are a convenient way to store and manipulate data in Python. They are a subclass of the class type and are defined using the @...