Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Chris Green Newsgroups: comp.lang.python Subject: Re: What does this "See help(type(self)) for accurate signature." actually mean? Date: Mon, 16 Mar 2026 08:53:29 +0000 Lines: 44 Message-ID: <91tk8m-kgoe3.ln1@q957.zbmc.eu> References: <4b9i8m-p1m93.ln1@q957.zbmc.eu> <10p77tm$1eam9$3@dont-email.me> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net BwI4qt68kFyDtVq/Z4hplQF8rihs27M7PU75/4/qrDIy4j85A= X-Orig-Path: not-for-mail Cancel-Lock: sha1:IU6dls6kiWb7u5yNXy8/svEdCg0= sha256:KXDUOHvgaXb2VQVD6grYqNrkkIeHgUlk+9GuXdbQLu8= User-Agent: tin/2.6.5-20250409 ("Helmsdale") (Linux/6.12.63+deb13-amd64 (x86_64)) Xref: csiph.com comp.lang.python:197731 Lawrence D’Oliveiro wrote: > On Sun, 15 Mar 2026 09:05:08 +0000, Chris Green wrote: > > > I see this message in several places in the help() output for gpiod: > > "See help(type(self)) for accurate signature.", but I can't work out > > what I actually need to type into help() to get a result. > > > > So, for example, I say 'help("gpiod.line_settings")', I see, among > > other things:- > > > > | __init__( > > | self, > > | direction: gpiod.line.Direction = , > > | edge_detection: gpiod.line.Edge = , > > | bias: gpiod.line.Bias = , > > | drive: gpiod.line.Drive = , > > | active_low: bool = False, > > | debounce_period: datetime.timedelta = datetime.timedelta(0), > > | event_clock: gpiod.line.Clock = , > > | output_value: gpiod.line.Value = > > | ) -> None > > | Initialize self. See help(type(self)) for accurate signature. > > > > What do I actually need to type to get that "accurate signature"? > > Actually, you’ve got it right there. When you call the class to create > an instance, you are actually calling the __init__ method (or the > __new__ method, if that’s defined). So the arguments you need to pass > are exactly those accepted by that method. No need to look anywhere > else for the “accurate signature”, since you have just posted it. > > Or it just means that the detailed docstring explaining what all those > args are for is attached to the class, not this __init__ method. Yes, I realise that the __init__ method shows the signature. In that case what does that "See help(type(self)) for accurate signature" mean then? I was hoping it might provide some more detail somewhere/somehow. The same phrase occurs in other places, I'll see if any aren't like this one where the arguments are there anyway. -- Chris Green ·