bobjacobsen / python-openlcb

MIT License
2 stars 1 forks source link

Possible attempt to cast using non-Pythonic code #3

Closed Poikilos closed 8 months ago

Poikilos commented 8 months ago

After PR, we should figure out what this is trying to do and correct it:

bobjacobsen commented 8 months ago

I think this line

self.processor : Processor = LocalNodeProcessor(LinkMockLayer(NodeID(100)))

is meant to create a LocoNodeProcessor that's using a mock version (supplied locally) of a LinkLayer that in turn is using a NodeID to identify the local node. The ID of that NodeID is arbitrary, any non-zero positive number would work, so I put in 100.

This code probably needs a few more comments....

bobjacobsen commented 8 months ago

Thanks for reading so carefully!

This line

sentMessages : [Message] = []

is stil in Swift syntax, and wasn't properly converted to Python. It should be just

sentMessages  = []

without the Swift type information.

bobjacobsen commented 8 months ago

Oops. I missed the type information in that 1st comment, and was replying to the wrong thing. My apologies.

Yes, the : Processor part is a left-over Swift-ism that shouldn't be there.