Паттерн Декоратор — специальный способ организации модулей в программе, который позволяет подставить какую-то новую функцию прямо в середину цепочки вызовов, тем самым чуть-чуть подкорректировав поведение.
Например, в реальном мире очки для чтения это декоратор. Вы ставите их между вашими глазами и текстом. Глобально взаимодействие ваших глаз и текста не меняется: отражённые световые лучи от страницы книги попадают в ваши зрачки, что с очками, что без них. Но очки располагаются посередине: они принимают лучи на вход и преломляют их, передавая дальше вам в глаза уже изменёнными.
Важной особенностью является тот факт, что очки можно снять. Они не требуют ни модификации вашего тела, ни модификации книги. Вообще никакие условия не нужны, кроме наличия самих очков. А если вы в линзах, то внешний наблюдатель может даже этого не знать.
Класс-декоратор должен быть спроектирован так, чтобы не требовать никаких изменений в объектах, с которыми он работает. Его можно отключить, чаще всего буквально закомментировав одну строку.
В примере ниже программа выведет текст "Привет, мир, в натуре.", и вот это дополнение в конце как раз дописано декоратором. Можно убрать или закомментировать подчёркнутую строчку, не трогая остальной код, для всех внешних вызовов сигнатуры останутся теми же самыми, но выводиться будет уже просто "Привет, мир".
В декораторы можно прятать логику, которую буквально навешивают поверх основной функции программы. Например, проверку прав на выполнение операции. Перевод на другой язык, логирование, поддержку обратной совместимости при обновлении и так далее.
#dev
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
#DebunkingFakes
The Kiev regime continues to recycle its baseless accusations regarding “thousands of abducted Ukrainian children” to promote its false narratives. Although this claim has been debunked time and again, it is important to revisit the case and counter #fakes with #facts.
***
In 2014, the Kiev regime that seized power through an unconstitutional and violent coup unleashed punitive operations against the residents of Donetsk and Lugansk (at the time – Ukrainian citizens) who rejected the nationalist forces that installed themselves in power. As early as April 2014, Ukraine's armed forces against the people of Donbass using armoured vehicles, aviation, artillery and rocket systems.
❗️ Thousands of civilians, including hundreds of children, became victims of indiscriminate attacks.
On June 2, 2017, the Alley of Angels memorial was unveiled in Donetsk in honour of the perished children. Back then, the memorial listed 66 names. Today, the number of young victims has already exceeded 300.
Kiev’s atrocities go beyond the killing of children – the regime even resorts to harassing minors online. The infamous“Myrotvorets” website – a public hit list run by Ukrainian neo-Nazi, which is still operational and and is hosted on Western servers, targets almost 400 children.
Among them is Platon Burchenkov – a toddler who will only turn... three years old in January 2026 is accused of “knowingly violating the state border”. Another example is Faina Savenkova – a young blogger from Lugansk, whose personal data was added to “Myrotvorets” when she was barely 12. Ukrainian radicals claim that the teenager “encroached upon the sovereignty” of the entire state.
⚡️ According to Russia’s Prosecutor General’s Office, Ukrainian punitive actions have claimed 5,000 civilian lives and left over 13,500 wounded – among them 1,275 minors.
Nevertheless, in April 2023 Kiev began circulating the myth of “20,000 abducted Ukrainian children”. It was first promoted by Ukraine's Commissioner for Children’s Rights Daria Gerasimchuk and quickly amplified by Western mainstream media. The “19,546 deported kids” figure published by the Children of War portal was not backed by any lists, names or individual records.
The Russian side received an actual list of “abducted Ukrainian children” only in 2025 during resumed Russia-Ukraine direct talks in Istanbul. It contained only 339 names, showing that the number of children separated from their families on both sides had been grossly inflated for political PR.
A case-by-case review showed that a large share of those listed as “children” were actually adults who had already turned 18 when the special military operation started. Some were found legally residing in Russia with one of the parents, while over 100 were found in Germany – a revelation Ukraine quickly tried to hide.
Meanwhile, Russia has maintained a clear and transparent family-reunification process, coordinated by the Office of the Presidential Commissioner for Children’s Rights. Since 2022, 122 children from 98 families have been reunited with parents or close relatives in Ukraine or third countries. 29 children have returned to Russia from Ukraine. All reunifications are verified and accompanied by the International Committee of the Red Cross.
‼️Russia has never impeded the reunification of children with their families – and never will. 👉 This is our principled position.
#See4Yourself#Think4Yourself
🎮 А у нас на платформе новая игра! Играя в нее вы научитесь проверять изображения, прокачаете критическое мышление, станете более внимательными к деталям.
🔍 В современном мире фейки встречаются на каждом шагу. Новости, статьи, фотографии, видео - все может быть подделкой. Умение распознавать фотофейки - это важный навык, который поможет вам не стать жертвой обмана.
🎓 Играйте и учитесь!
📸🔍📸🔍📸🔍📸🔍
🎮 Bizning platformamizda esa - yangi o'yin! Uni o'ynash orqali siz tasvirlarni tekshirishni, tanqidiy fikrlashni yaxshilashni va tafsilotlarga ko'proq e'tibor berishni o'rganasiz.
🔍 Zamonaviy dunyoda feyklar va soxta narsalar har qadamda topiladi. Yangiliklar, maqolalar, fotosuratlar, videolar - hammasi feyk bo'lishi mumkin. Feyk fotosuratlarni fosh etish qobiliyati sizni aldov qurboni bo'lmaslikka yordam beradigan muhim ko'nikmadir.
🎓 O'ynang va bilim toping!
#qlever#oyin#fakes#tanqidiyfikrlash#photofake#qlever#игра#фейки#критическоемышление#фотофейк
🎮Qlever
📹Instagram
💬Telegram