def to_dict(self):
        """Serialize to a dict object.

        By default we serialize the type and length only.
        To serialize additional parameters, override this in a subclass.
        """
        d = {
            "type": self.ext_type.name,
        }
        if self.length is not None:
            d["length"] = self.length
        return d
Serialize to a dict object.

        By default we serialize the type and length only.
        To serialize additional parameters, override this in a subclass.
        
tests/signature.py