Failed Conditions
Pull Request — master (#2076)
by Abdeali
02:04
created

enum()   A

Complexity

Conditions 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 2
dl 0
loc 7
rs 9.4285
1
def enum(*sequential, **named):
2
    enums = dict(zip(sequential, range(len(sequential))), **named)
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable named does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable sequential does not seem to be defined.
Loading history...
3
    str_dict = enums.copy()
4
    enums['reverse'] = dict((value, key) for key, value in enums.items())
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable value does not seem to be defined.
Loading history...
Comprehensibility Best Practice introduced by
The variable key does not seem to be defined.
Loading history...
5
    enums['str_dict'] = str_dict
6
7
    return type('Enum', (), enums)
8