robotpy / pynetworktables

Pure python implementation of the FRC NetworkTables protocol
Other
60 stars 30 forks source link

add isValidDataType #71

Closed ariovistus closed 5 years ago

ariovistus commented 5 years ago

this is mostly just to get https://github.com/robotpy/robotpy-wpilib/pull/525 to compile, but I'm also not sure how much checking is appropriate for us

virtuald commented 5 years ago

NetworkTables already does a fair bit of internal type checking, so If you're going to add this function then please make it actually check the types.

Checking lists are tricky. See https://github.com/robotpy/pynetworktables/blob/master/ntcore/value.py#L76 for how pynetworktables does autochecking.

ariovistus commented 5 years ago

Ok. I could swear I saw something stuff a heterogeneous tuple into networktables

auscompgeek commented 5 years ago

I guess you might want to add in a test for this to catch errors like above.

I wonder whether it's actually worth adding this - an error would be raised upon attempting to add such a value to NetworkTables eventually.

virtuald commented 5 years ago

Thanks!