Skip to content

repr(VARIANT.missing) raises NotImplementedError #372

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
junkmd opened this issue Nov 7, 2022 · 2 comments
Closed

repr(VARIANT.missing) raises NotImplementedError #372

junkmd opened this issue Nov 7, 2022 · 2 comments

Comments

@junkmd
Copy link
Collaborator

junkmd commented Nov 7, 2022

It is very inconvenient when debugging, so let's add elif self is type(self).missing to __repr__.

def __repr__(self):
if self.vt & VT_BYREF:
return "VARIANT(vt=0x%x, byref(%r))" % (self.vt, self[0])
return "VARIANT(vt=0x%x, %r)" % (self.vt, self.value)

    def __repr__(self):
        if self.vt & VT_BYREF:
            return "VARIANT(vt=0x%x, byref(%r))" % (self.vt, self[0])
        elif self is type(self).missing:
            return "VARIANT.missing"
        return "VARIANT(vt=0x%x, %r)" % (self.vt, self.value)
@junkmd
Copy link
Collaborator Author

junkmd commented Nov 7, 2022

I will work this while adding type hints to comtypes.automation.

@junkmd
Copy link
Collaborator Author

junkmd commented Nov 14, 2022

This was resolved by #374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant