I went to github and looked at the python client generator code and started moving the version tag back one release at a time until I found the release (6.1.0) that last supported python 3.6 (2022). I pulled this release and built it and generated a python client from my spec.
Now I have to ask - Rather than generating standard python 3.4+ Enum classes:
from enum import Enum
class NetIdEnum(Enum):
RDMA = "RDMA"
RDMA6 = "RDMA6"
TCP = "TCP"
TCP6 = "TCP6"
Or, if scoping is a concern:
from enum import Enum
class QualifiedAddressView(NormalMode):
class NetIdEnum(Enum):
RDMA = "RDMA"
RDMA6 = "RDMA6"
TCP = "TCP"
TCP6 = "TCP6"
it does this:
class QualifiedAddressView(ModelNormal):
...
allowed_values = {
('net_id',): {
'RDMA': "RDMA",
'RDMA6': "RDMA6",
'TCP': "TCP",
'TCP6': "TCP6",
},
}
which makes for pretty unwieldy client usage:
if QualifiedAddressView.allowed_values[('net_id',)]['RDMA'] == "RDMA":
print("This is an RDMA type")
rather than the much simpler:
# Checking the value of net_id
if address.net_id == QualifiedAddressView.NetIdEnum.RDMA:
print("This address uses RDMA protocol")
Can anyone expound on why this choice was made?