TIP: Click on subject to list as thread! ANSI
echo: rberrypi
to: R.WIESER
from: RICHARD KETTLEWELL
date: 2019-12-04 07:53:00
subject: Re: RPi.GPIO-0.7.0 - a fe

"R.Wieser"  writes:
>> newfunc PyTypeObject.tp_new
>>
>>    An optional pointer to an instance creation function.
>
> That part I understood (from the fields name).
>
> My doubt was/is if the current way its done would perhaps result in a
> (sort of) singleton, and moving the "PyType_GenericNew" reference into
> the table itself would possibly cause multiple instances to be
> created.

Both strategies still have the same behavior. The choice of assignment vs
initialisation does not make any difference here. It certainly isn’t
going to cause the function to be called different numbers of times at
some point in the future; if you think that it is then you need to
revisit your mental model of what is going on here.

--
https://www.greenend.org.uk/rjk/

--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)

SOURCE: echomail via QWK@docsplace.org

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.