Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #4443

Re: Py_INCREF() incomprehension

Date 2011-05-02 08:41 +0200
From Hegedüs, Ervin <airween@gmail.com>
Subject Re: Py_INCREF() incomprehension
References (5 earlier) <ip70b8$3lv$1@r03.glglgl.eu> <mailman.858.1303843478.9059.python-list@python.org> <ip8pc1$qb8$1@r03.glglgl.eu> <mailman.1044.1304280052.9059.python-list@python.org> <ipkvmd$cu5$1@r03.glglgl.eu>
Newsgroups comp.lang.python
Message-ID <mailman.1059.1304318485.9059.python-list@python.org> (permalink)

Show all headers | View raw


hello,

Thomas, Gregory,

thank you for your ansrwers,

> I guess this is the point where yo should start printf programing.


oh', already done :)
 
> * What happens during module initialization?
successfully initialized,

> * What happens n the functions?
> * Where does the stuff fail?
> * What are the reference counts of the involved objects?

sorry for the dumb question: how can I controll number of
reference in C?
 
> >     PyModule_AddObject(o, "error", cibcrypt_error_nokey);
> >     Py_INCREF(cibcrypt_error_nokey);
> >
> >and now if there is some expected exception, I get it.
> 
> >Any explanation?
> 
> I don't have one - I would think that if the module object exists
> for all the time, it would be enough to have one reference there.
> 
> But obviously it is not enough - did you at any time del something
> related to here? The module or one of its attributes?
> 
> Anyway, it seems safer to do INCREF here - so do it. (As Gregory
> already stated - it looks cleaner if you do INCREF before
> AddObject.)

ok,
 
> 
> >ps: this is just for my passion, but I would like to understand
> >it very-very much :)
> 
> Understandable. That's that the printf debugging of the refcounts
> can be good for - even if you don't really have a problem.

thanks, I'll go to read the docs :)

bye:

a.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Py_INCREF() incomprehension Ervin Hegedüs <airween@gmail.com> - 2011-04-26 11:48 +0200
  Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-26 14:23 +0200
  Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-26 14:21 +0200
    Re: Py_INCREF() incomprehension Hegedüs Ervin <airween@gmail.com> - 2011-04-26 16:03 +0200
      Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-26 18:08 +0200
        Re: Py_INCREF() incomprehension Hegedüs Ervin <airween@gmail.com> - 2011-04-26 19:28 +0200
          Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-26 19:45 +0200
            Re: Py_INCREF() incomprehension Hegedüs Ervin <airween@gmail.com> - 2011-04-26 20:44 +0200
              Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-04-27 11:58 +0200
                Re: Py_INCREF() incomprehension Hegedüs Ervin <airween@gmail.com> - 2011-05-01 22:00 +0200
                Re: Py_INCREF() incomprehension Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2011-05-02 10:48 +1200
                Re: Py_INCREF() incomprehension Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2011-05-02 02:59 +0200
                Re: Py_INCREF() incomprehension Hegedüs, Ervin <airween@gmail.com> - 2011-05-02 08:41 +0200
                Re: Py_INCREF() incomprehension Stefan Behnel <stefan_ml@behnel.de> - 2011-05-02 09:07 +0200

csiph-web