Skip to content
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

Doesn't parse "records" #28

Open
realh opened this issue Feb 3, 2019 · 4 comments
Open

Doesn't parse "records" #28

realh opened this issue Feb 3, 2019 · 4 comments

Comments

@realh
Copy link
Collaborator

realh commented Feb 3, 2019

fakegir seems to miss out "record" items, which is what gi calls structs. structs may have methods. They're quite important in some libraries, so fakegir not supporting them is a big hindrance.

@kastixx
Copy link
Collaborator

kastixx commented Feb 5, 2019

Does PR #29 fix that issue?

@realh
Copy link
Collaborator Author

realh commented Feb 5, 2019

Yes, but only partially, because it doesn't support fields. I'm not sure how best to deal with them. If output classes had a constructor that set those fields with type annotations, would jedi etc be able to introspect them?

@kastixx
Copy link
Collaborator

kastixx commented Feb 7, 2019

Probably it won't. It's not possible to assign a docstring to class attribute, here's an explanation: https://stackoverflow.com/questions/3051241/how-to-document-class-attributes-in-python .

A possible work-around would be adding an empty property for each field:

class Foo:
    @property
    def field_name(self):
        """Docstring for field_name"""
        pass

@realh
Copy link
Collaborator Author

realh commented Feb 12, 2019

That sounds like a good idea. Shall I give it a try and open a new PR?

strycore added a commit that referenced this issue Feb 13, 2019
Add fields to records (further improvement to address #28)
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

2 participants