Aug-15-2019, 03:42 PM
(Aug-15-2019, 03:33 PM)metulburr Wrote:(Aug-15-2019, 03:08 PM)RMJFlack Wrote: redefining the type of the result of a library function between versions (struct.pack for example). very uncool.One change between python3.x and python2.x was bytes and strings. Like with any language, if you are using C++14 syntax and try to compile it in a c++98 compiler you are going to get errors. The same is true with python2.x/python3.x interpreters.
I would use a python3.x tutorial at this point. Python2.x is dead soon.
But WHY would they break existing code by redefining the type of the result of struct.pack, rather than introduce a NEW function struct.pack2byte or some such.
There is always a reason of course (and I am curious about this one) its just frustrating the amount of time I seem to have to spend figureing out whats changed and then figure out what I have to do with my code. Maybe the issue is that Im not doing this full time. Maybe Python is for pros only? I guess I have been able to gloss over the byte / string thing, looks like Im going to have to get a better understanding (it doesnt help that the code Im dealing with here was not written by me).