Skip to content
This repository was archived by the owner on Mar 8, 2024. It is now read-only.
This repository was archived by the owner on Mar 8, 2024. It is now read-only.

Code is unreachable issue using Pylance #217

Open
@turabek-cc

Description

@turabek-cc

I am using Pylance and while the Pycrate code works, some parts after encoding/decoding are grayed out as unreachable.
The easiest solution is replacing 'ASN1NotSuppErr' with 'NotImplementedError' in 'pycrate_asn1rt/asnobj.py'.
Other options are given at microsoft/pylance-release#2092 (comment)
It would be a nice improvement for those who use static type analyzers.

Pycrate version: 0.5.5
Pylance version: v2022.11.30

Example to reproduce the issue.

from pycrate_asn1dir.ITS_IEEE1609_2 import Ieee1609Dot2BaseTypes

signature = Ieee1609Dot2BaseTypes.Signature

signature.from_coer(
    bytes.fromhex(
        "808211111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
    )
)

print(signature.get_val()) # shown unreachable, but reachable 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions