Python convention: function constructor for a private class

I have noticed this in Python's threading module source:

def Event(*args, **kwargs):
  return _Event(*args, **kwargs)

class _Event(_Verbose):
  ...

Am I correct in assuming this is an attempt in mimicking a "sealed" class (c#) or a "final" class (java) in other languages? Is this a common pattern in Python? Are there any other approaches to this problem in Python?

9
задан Daniel Huckstep 21 January 2011 в 10:58
поделиться