0

I have seen this coding pattern in codes I am (re)writing:

class Outside(object):
    pass

Outside.example = 10.

My instinct was that I didn't like it! I'd prefer:

class Inside(object):
    example = 10.

Are there any advantages or situations where the former is preferred?

innisfree
  • 2,044
  • 1
  • 14
  • 24

0 Answers0