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

Analyze class assignments outside of their class scope #13

Open
mwhudson opened this issue Jan 12, 2015 · 2 comments
Open

Analyze class assignments outside of their class scope #13

mwhudson opened this issue Jan 12, 2015 · 2 comments
Labels
astbuilder A substantive change is required in the astbuilder flow in order to fix this issue Confirmed This issue has been confirmed by a core pydoctor dev enhancement

Comments

@mwhudson
Copy link
Contributor

mwhudson commented Jan 12, 2015

Pydoctor does not generate documentation for classes wrapped by SWIG (www.swig.org). SWIG creates classes like this:

class event(object):
    thisown = _swig_property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc='The membership flag')
    __repr__ = _swig_repr
    def __init__(self, _args, *_kwargs):
        _events.event_swiginit(self,_events.new_event(_args, *_kwargs))
    __swig_destroy__ = _events.delete_event
event.loop_once = new_instancemethod(_events.event_loop_once,None,event)
event.loop_wait = new_instancemethod(_events.event_loop_wait,None,event)
event_swigregister = _events.event_swigregister
event_swigregister(event)

pydoctor will in this case only document event.__init__(). It would be nice if it would also document event.loop_once and event.loop_wait.

Jelmer Vernooij - http://samba.org/~jelmer/
Jabber:


Imported from Launchpad using lp2gh.

@mwhudson mwhudson added Confirmed This issue has been confirmed by a core pydoctor dev Low labels Jan 12, 2015
@mwhudson
Copy link
Contributor Author

(by mwhudson)
Yuck :)

Something can probably be done, though.

@tristanlatr
Copy link
Contributor

tristanlatr commented Jun 17, 2021

This issue could be renamed as follow: "Analyze class assignments outside of their class scope".

This is valid python:

class Point:
    x:int
    y:int

def __init__Point(self, x, y):
    self.x = x
    self.y = y

Point.__init__ = __init__Point

Currently, the __init__ is not documented. Should not be too hard to fix...

@tristanlatr tristanlatr added astbuilder A substantive change is required in the astbuilder flow in order to fix this issue enhancement and removed Low priority labels Jun 17, 2021
@tristanlatr tristanlatr changed the title Does not work with SWIG-generated classes Analyze class assignments outside of their class scope Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astbuilder A substantive change is required in the astbuilder flow in order to fix this issue Confirmed This issue has been confirmed by a core pydoctor dev enhancement
Projects
None yet
Development

No branches or pull requests

2 participants