-1

I understand that enum is a class I can inherit from to make my class iterable over the objects.

But what does enum() function do, as shown in this code snippet below?

enums = [enum(domain, [], q=subdomains_queue, silent=silent, verbose=verbose) for enum in chosenEnums]
for enum in enums:
    enum.start()
for enum in enums:
    enum.join()
Mahathi Vempati
  • 1,238
  • 1
  • 12
  • 33
  • See https://stackoverflow.com/questions/702834/whats-the-common-practice-for-enums-in-python and https://stackoverflow.com/questions/36932/how-can-i-represent-an-enum-in-python and https://docs.python.org/3/library/enum.html – Mazdak Jun 26 '18 at 08:49

1 Answers1

4

enum is not a class you can inherit from; Enum in the enum module is (see the documentation).

The enum() in the code you are describing is a callable object that has previously been put into the list chosenEnums. We can't tell you what it is, or does, without the rest of the code.

Ethan Furman
  • 63,992
  • 20
  • 159
  • 237
Jack Aidley
  • 19,439
  • 7
  • 43
  • 70