Closed Schwaneberg closed 8 months ago
I recommend to change the second return to return (end, None)
You're right. Would you mind creating a PR? Otherwise I'll fix it by myself, but it may take some more time.
I guess it would make sense to change the type annotation from Tuple to List and always return a list.
I failed trying to fix the signature of the existing function. Therefore, release 0.1.0 contains a new function called find_frame
which always returns a fixed-size tuple. New code should prefer this function over the older parse_frame
.
Thank you for your report! I'm sorry for the long delay.
Thank you very much! I could have created the PR - sorry I didn't respond in time.
Am So., 8. Okt. 2023 um 12:36 Uhr schrieb mtdcr @.***>:
Closed #13 https://github.com/mtdcr/pysml/issues/13 as completed.
— Reply to this email directly, view it on GitHub https://github.com/mtdcr/pysml/issues/13#event-10583794053, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIM6TNMLUMS2XF5L6ELKGSLX6J625AVCNFSM6AAAAAAYJUDAE6VHI2DSMVQWIX3LMV45UABCJFZXG5LFIV3GK3TUJZXXI2LGNFRWC5DJN5XDWMJQGU4DGNZZGQYDKMY . You are receiving this because you authored the thread.Message ID: @.***>
The type hint
Tuple[int, Optional[SmlFrame]]
is ok for the first returnreturn [match.end(), obj]
(hoewever,List[int, Optional[SmlFrame]]
would be the acurate hint), but not for the secondreturn [end]
.This causes an unexpected ValueError, if you do stuff like
_, frame = SmlBase.parse_frame(sml_frame)
.