News for hackers. Stuff that matters.
Re:Python-patterns – A collection of design patterns/idioms ... by akx on Tuesday May 31, 2022 @02:22AM (#31566633)
You could absolutely write `encapsulate`, but you will lose out on all of the established code completion and other IDE features.
Re:Python-patterns – A collection of design patterns/idioms ... by TekMol on Tuesday May 31, 2022 @02:27AM (#31566651)
How would encapsulate look like? Would it have a negative performance impact?

I don't care about code completion at all. When I type "a", I don't want anything to happen on my screen except for an "a" to appear. I think that all the flickering stuff that the average programmer experiences on their screen burns more mental energy than it saves.

Re:Python-patterns – A collection of design patterns/idioms ... by LittlePeter on Tuesday May 31, 2022 @03:54AM (#31567073)
I once had a working "encapsulate" but lost the code. That code was modified version of this: https://docs.python.org/3/library/importlib.html#approximati...

My "encapsulate" was 4 lines of code at most IIRC. As someone mentioned, autocomplete in PyCharm did not work.

Re:Python-patterns – A collection of design patterns/idioms ... by _ZeD_ on Tuesday May 31, 2022 @07:46AM (#31568431)
I hope you are talking about code you use internally and don't share.

FWIW I care about code completion, and using a library that broke my workflow is not fun.