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

"R.Wieser"  writes:
> Richard,
>> Yes. tp_new, and therefore PyType_GenericNew, are called precisely
>> as many times as you create a PWM instance. No more, no less.
>
> Am I speaking some foreign language perhaps ?   I really thought that my
> English/American wasn't /that/ bad.    'Cause no matter how I say it you do
> not seem to understand what I'm trying to explain (you just repeat the same
> phrase over-and-over again) :-(

You don’t seem to be paying attention to the answers.

> According to me line "PWMType.tp_new = PyType_GenericNew;" creates a
> single instance,

It doesn’t create an instance of anything. It just sets tp_new to
PyType_GenericNew.

> and than (one of the methods of) that instance is called thru
> accessing the tables "tp_new" field

Instances of the PWM type are created by calling tp_new with &PWMType as
is first argument (plus some other details). In both cases, tp_new is
set to PyType_GenericNew. The number of instances of the PWM type
created is the same as the number of calls.

> But if-and-when you put the "PyType_GenericNew" into the table itself you
> will, as far as I can tell, create a new instance every time (yes ?  no?).

Neither way of setting tp_new creates anything. They both just set the
value of tp_new to PyType_GenericNew. I have no idea why you think it
does anything else.

> Thats a BIG difference.    Care to explain how that /doesn't/ happen ?
>
> In short, the ammount of calls does not interest me in the slightest.

The number of calls through tp_new is precisely the same as the number
of PWM instances created.

--
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™.