Python Function Cannot Be Overridden
How to prevent a function from being overridden in python [duplicate] This question already has answers here: Making functions non-overridable Is there a way to make a class function unoverridable? something like java’s final keyword, i.e. any overriding class cannot override that method. python overriding final 4 Answers You could put a comment in there to the effect of: # We'll fire you if you override this method. It's surprising how well low-tech solutions like this work in practice.
A Stack Overflow screenshot shows a programmer asking how to make a Python class method impossible to override, similar to Java’s final keyword. The answer jokingly suggests adding a comment threatening to fire anyone who overrides it, poking fun at the surprising effectiveness of workplace pressure as a low-tech solution. EN: A Stack Overflow screenshot shows a programmer asking how to make a Python class method impossible to override, similar to Java’s final keyword. The answer jokingly suggests adding a comment threatening to fire anyone who overrides it, poking fun at the surprising effectiveness of workplace pressure as a low-tech solution.
Stack Overflow webpage / страница Stack Overflowcomputer screen / экран компьютераprogramming question / вопрос по программированиюPython code / код PythonJava keyword / ключевое слово Javaclass method / метод классаtext comment / текстовый комментарийanswer section / раздел ответовwebsite sidebar / боковая панель сайтаupvote arrows / стрелки голосования
#python#питон#programming#программирование#stackoverflow#coding#кодинг#developer#разработчик#function#функция#overriding#переопределение#final keyword#ключевое слово final#workplace humor#офисный юмор#low-tech solution#низкотехнологичное решение#reaction#реакция#screenshot#скриншот#tech meme#технический мем
- @ithueti / 7067 2022-07-15
- Template
- Stack Overflow screenshot
- Type
- image
- Size
- 800×530 · 51.6 KiB
- Mood
- sarcastic
- Language
- en
- Added