Skip to main content

All Questions

-2 votes
1 answer
295 views

Defining functions inside vs outside a class

Say I have a class with a function do_thing that is comprised of multiple steps, which themselves segregate into functions (first_process and second_process). At what point would this be considered ...
Tim Kirkwood's user avatar
2 votes
0 answers
34 views

Update class member gradually [duplicate]

Consider the following: import typing class MyClass(object): def __init__(self): self.my_member: typing.Optional[dict] = None def update_member(self): self.my_member = {} ...
Spack's user avatar
  • 129
0 votes
3 answers
2k views

When NOT to use a class / member variable?

I am trying to learn WHEN NOT to use: classes member variables HERE IS THE CODE access_point_detection_classes.py from scapy.all import * class Handler : def __init__(self) : self....
ma77c's user avatar
  • 119
3 votes
3 answers
7k views

What is the difference between proxy class and delegation in Python?

Wiki: A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or ...
direprobs's user avatar
  • 131