#decorator

2025-05-18

Продвинутое использование декораторов Python

Привет хабр! продолжаю цикл статей про python разработку. В данной статье продолжаю материал прошлой и хочу углубиться в тему декораторов, показать относительно сложные, но применимые в реальной практике примеры использования декораторов, дам небольшую теоретическую базу и некоторое количество ссылок на полезные материалы по теме. Думаю, последние разделы статьи будут полезны даже для опытных разработчиков. Как обычно буду очень рад критике и предложениям по улучшению материала.

habr.com/ru/articles/910424/

#python #python3 #decorator #декоратор #декораторы #decorators #программирование #сигнатура

2025-05-01

#PHP #Laravel #Design Pattern: Improving #Telescope with Unorthodox #Decorator 🧩

When standard debugging tools couldn't handle a complex #API (JSON wrapped in Base64 wrapped in #SOAP), a creative solution emerged.

🧵 👇

2025-03-07

Паттерны «Банды четырех»: примеры применения в реальном проекте

Как-то мне выпало написать небольшой микросервис, код которого практически полностью состоял их одних реализаций паттернов "Банды четырех". В этой статье я хочу рассказать о том, как последовательное решение поставленной задачи приводило к использованию все новых паттернов, и как эти паттерны взаимодействовали между собой. Будет много схем и кода, демонстрирующих практические примеры применения паттернов Композит, Билдер, Визитер, Цепочка обязанностей и Декоратор. Не смотря на то, что примеры кода написаны на PHP, статья может оказаться интересной и для разработчиков, использующих другие языки.

habr.com/ru/articles/888790/

#паттерны_проектирования #банда_четырёх #visitor #builder #composite #chain_of_responsibility #decorator

ƧƿѦςɛ♏ѦਹѤʞspacemagick
2025-01-07

Revenge on the Wall: Painter’s Message Goes Viral in Bolsover

In January 2020, a quiet street in Bolsover, England, became the unlikely setting for a bold act of revenge that quickly made headlines across the UK.

When a dispute between a painter and his client reached boiling point, the result was a striking message that turned the town into the center of national attention.

The Dispute That Sparked It All

Dean Reeves, a professional painter and decorator, was hired to transform the exterior of the former North Star Club building, which was being converted into flats. Reeves claims that after completing the work, his client refused to pay £500 ($645) of the agreed fee. According to Reeves, he was asked to take on additional tasks beyond their initial agreement, with payment withheld until he complied.

Frustrated and feeling cheated, Reeves decided to make his dissatisfaction clear—on the very walls he had painted.

The Message on the Wall:

Frustrated and determined to make his point, Reeves took to the very canvas he had painted – the building’s exterior. His bold graffiti message read: “Want your house painting? Don’t be like Terry, pay the bill! Now you will!” The message, written in stark black paint, stood in sharp contrast to the freshly painted cream walls.

More: 7 Famous Street Art Pieces That Echo Environmental Awareness

The striking message didn’t just draw the attention of Bolsover residents – it captured headlines nationwide.

Featured prominently in newspapers like The Daily Mirror and The Sun, the story resonated with tradespeople and the public alike. Reeves’ actions sparked a mix of reactions, from those praising his ingenuity to others debating the professionalism of his response.

In Reeves’ own words, he decided to take action after being told repeatedly, “I’ll pay you tomorrow.” Tomorrow, however, never came. The building, which was being converted into flats, now served as a public reminder of the importance of honoring agreements.

Was Dean Reeves justified in taking this stand, or would you have handled the situation differently?

#Bolsover #decorator #england #graffiti #painter #paymentDisputes #StreetArt #tradespeople #viralStories

A newspaper page featuring a wide shot of the cream-colored building in Bolsover with bold graffiti reading: "Want your house painting? Don’t be like Terry, pay the bill! Now you will!" A small inset shows Dean Reeves in white overalls next to the graffiti, and the article describes his act of revenge against a client who allegedly refused to pay.A newspaper page titled “Painter and Decirater” featuring Dean Reeves standing in front of a cream-colored building with his graffiti message in bold black paint: "Want your house painting? Don’t be like Terry, pay the bill! Now you will!" The article discusses the dispute and Reeves’ act of defiance.
2024-11-30

I don’t often decorate classes, but when I did, I didn’t have to

blog.narf.ssji.net/2024/11/30/

I have a few different classes implementing a specific behaviour, and want to find a specific one. What do I do?

Classes can be decorated in the same way as functions, and a decorated can be written to add each class to a list, for later searching.

However, for this stated purpose, it’s not necessary, as class inheritance is better suited, and parent classes have a __subclasses__ method returning a similar list.

#decorator #Python

2024-09-01

Une exploration des possibilités offertes par les décorateurs JavaScript. Ils sont au stage 3 sur 4 de leur standardisation, mais sont déjà supportés par TypeScript et Babel.

J'ai toujours un peu du mal avec cette façon de faire. Je trouve que ça ajoute une couche de magie un peu trop abstraite et invisibilisée à mon goût, mais j'essayerai de m'y mettre.

Exploring the Possibilities of Native JavaScript Decorators – Frontend Masters Boost
frontendmasters.com/blog/explo

#javascript #decorator

Ghostsigns (Sam Roberts)ghostsigns
2024-07-29

From regular correspondent, Wayne Tanswell Signwriter, the many and varied services of E.F. Andrews, Felixstowe, Suffolk.

E.F. Andrews
Decorator, Plumber & Sanitary Engineer
Building & General Repairs
Rathbone Furnishing Stores

136 Hamilton Rd, Felixstowe IP11
Streetview: maps.app.goo.gl/6amaGByQ7Q16Qz

Photo: Wayne Tanswell, waynetanswell-signwriter.co.uk/

Fading painted sign filling the upper portion of a gable end wall.
2024-06-30

New blog post: Python CLI backward compatibility decorator

Click sometimes introduces too much coupling between the CLI and the underlying Python functions. It is possible to break this coupling using dedicated decorators, so we can refactor the Python code as needed withouth breaking the existing CLI usage.

https://blog.narf.ssji.net/2024/06/30/python-cli-backward-compatibility-decorator/

#Click #decorator #Python #code #tip

Screenshot of a terminal running a Python script. ./cmd.py --option 1 --option 2 3 option=None arguments=(1, 2, 3)
Cyrille Pontvieuxcpontvieux@piaille.fr
2024-06-04

@nedbat Very funny usage of #python #decorator !

2024-05-27

Декораторы в python по книгам

С Python я знаком давно, в основном пишу бэкенд на Django. Сейчас работаю на нескольких работах, на одной выполняю роль бэкенд-разработчика, а на другой - лида веб отдела. Недавно наткнулся на тему в вузе, которую я давно хотел изучить - декораторы . Используются они много где, особенно удобно в фреймворках просто перед функцией написать какую-нибудь магическую строчку с @ и всё готово. Примерно понимал как они работают, но учиться никогда не поздно, так что попробую разобрать основные технические детали работы декораторов (только для функций). Статья подойдёт тем, кто просто зашёл узнать пару фактов про декораторы и хочет узнать синтаксис. Также раскрою немного глубже в техническую часть декораторов. Хорошие источники по этой теме - в конце. Также была использована великолепная статья: «Python декораторы на максималках. Универсальный рецепт по написанию и аннотированию от мала до велика» Узнать про декораторы

habr.com/ru/articles/817445/

#python_3 #decorators #decorator #декораторы #питон #книги_по_программированию #функции

2024-05-02

Используем паттерн Decorator в Bitrix

Применять паттерны программирования — хорошая практика. К сожалению, на проектах CMS Bitrix редко встречаются примеры использования. В статье я покажу на примере, как можно использовать паттерн Decorator. А также рассмотрю этот паттерн в целом: его распространенные реализации в PHP, возможные альтернативы и ситуации, в которых лучше избегать его использования. Читать далее!

habr.com/ru/articles/788412/

#декораторы #битрикс #php #decorator

2024-03-15

Замыкания и декораторы в Python: часть 2 — декораторы

Уважаемые читатели, рад вас приветствовать в новой статье. Этот материал является продолжением предыдущей публикации , посвященной замыканиям. В данной части обзора мы углубимся в тему декораторов. Эта статья написана в первую очередь для тех, кто только начинает свой путь в программировании или начал изучать Python. Потому здесь я не буду рассматривать декораторы классов, чтобы сделать материал более доступным для новичков. Тем не менее, для тех, кто изучит данную статью, не составит труда разобраться в декораторах классов, так как они не имеют существенных отличий от рассматриваемых здесь декораторов функций.

habr.com/ru/articles/800239/

#python #декораторы #decorator

Moved to Mastodon, See Belowghostsigns@pixelfed.social
2024-01-28
This is nice; a laminate of some sort coming off the doors to reveal the hand-painted sign beneath.

The sign was visible in this form for a few years, until it was painted over in the recent redecoration/refurbishment of the building at 36 Park Road, Nottingham—work that likely *wasn't* carried by H. Wiltshire & Sons Ltd. Apart from the date of establishment (1905) given on the sign, I've not found out anything more about the firm itself.

You can trace the sign's recent history via google streetview, including the coming away of the right side of the laminate some time between 2012–14: https://maps.app.goo.gl/EZUnRxG8WncDAxyV6.

Photo and location details kindly shared by Carmen Palmer.

#ghostsigns #ghostsign #lenton #nottingham #notts #door #doors #wiltshire #builder #decorator
Double doors to a red brick building with a white lintel above. They are painted green, in poor condition, with a blue laminate coming away to reveal faded white lettering with a block shade that reads: "H. Wiltshire & Sons Ltd, Builders & Decorators, Est. 1905, Phone 44286".
Nicolas Fränkel 🇺🇦🇬🇪frankel@mastodon.top
2024-01-09
TonySpegeltonyspegel
2023-12-10

Ein Post über den (größtenteils) geglückten Versuch, einen Event-Emitter Standard Decorator zu entwickeln. Der Decorator hilft, indem er einen Custom Events einfacher erstellen lässt, um mit diesem unter anderem zwischen (Web) Components unabhängig des DOM zu kommunizieren.

tony-spegel.com/blog/event-emi

github.com/TonySpegel/event-em

Nicolas Fränkel 🇺🇦🇬🇪frankel@mastodon.top
2023-10-20

The #Python #Decorator That Supercharges Developer Experience (sic). TIL: you can overload functions/methods in Python

pub.towardsai.net/the-python-d

TonySpegeltonyspegel
2023-10-05

Wie man einen Standard Decorator entwickeln kann, um die Inhalte eines zu einem <slot>- zugewiesenen Elements bequemer zu verarbeiten:

tony-spegel.com/blog/query-ass

github.com/TonySpegel/query-as

Kompatibel mit 5.x.x und dem aktuellen Lit 3.0 Prerelease 2.

2022-11-21

Professional Handyman Services for the LGBTQ+ & wider community in SW London & Surrey
VISIT MY WEBSITE FOR MORE INFO 👷🏻‍♂️🌈⚒️
davethegayhandyman.co.uk

# davethegayhandyman #davegayhandyman #handyman #gayhandyman #handyperson #gayhandyperson #instagay #LGBTQ #gaybusiness #gayfollow #gaylondon #gay #handymanservice #homeimprovements #locks #decorator #painter #wallpapering #fencing #picturehanging #carpenter #electrical #flatpacks #jetwash #clapham #oval #balham #epsom #london #surrey

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst