Please look at the below code.
signal = {
"id": "p752",
}
class Trigger:
def __init__(self, signal):
self.id = signal['id'],
print(type(signal['id']))
print(type(self.id))
def get_trigger(self):
print(self.id)
t1 = Trigger(signal)
t1.get_trigger()
The output I get is
<class 'str'>
<class 'tuple'>
('p752',)
I honestly don't know what is happening here. When I assign signal['id'] to 'id' inside the constructor why is changing to a tuple?