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


Groups > de.comp.lang.python > #5535

Argumente in Python-C-Extension parsen

X-Received by 2002:a37:4b42:: with SMTP id y63mr20538693qka.450.1566892564531; Tue, 27 Aug 2019 00:56:04 -0700 (PDT)
X-Received by 2002:a37:4c82:: with SMTP id z124mr20441845qka.186.1566892564261; Tue, 27 Aug 2019 00:56:04 -0700 (PDT)
Path csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!a13no10362307qtd.0!news-out.google.com!d29ni3143qtg.1!nntp.google.com!a13no10362300qtd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups de.comp.lang.python
Date Tue, 27 Aug 2019 00:56:04 -0700 (PDT)
Complaints-To groups-abuse@google.com
Injection-Info glegroupsg2000goo.googlegroups.com; posting-host=194.208.5.133; posting-account=2398iQoAAADZ5r0xIf0FAeS1GxPIO-SX
NNTP-Posting-Host 194.208.5.133
User-Agent G2/1.0
MIME-Version 1.0
Message-ID <bbae8f87-a8cb-442d-ac71-7b8cddf41f8f@googlegroups.com> (permalink)
Subject Argumente in Python-C-Extension parsen
From Guenther Sohler <guenther.sohler@gmail.com>
Injection-Date Tue, 27 Aug 2019 07:56:04 +0000
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding quoted-printable
Lines 27
Xref csiph.com de.comp.lang.python:5535

Show key headers only | View raw


Hallo Gruppe,

Derzeit bin Ich dabei, in einer C-Extension Übergabeparameter zu extrahieren.
Leider ist das Argument kein einfaches Int oder String, sondern eine Klasse,
die von object abgeleitet ist und die passende Doku habe ich auch noch nicht erkannt/gefunden.


class MyClass(object):
    def __init__(self):
       self.value1=1
       self.value2=[2,3]
       self.value3=Subclass()


Angefangen habe ich mit 

if (!PyArg_ParseTuple(args, "OO",&arg1, &arg2)) {
    return NULL;
}

Aber wie kann ich nun aus arg1 die value1, value2, und  value3 extrahieren oder überhaupt herausfinden, welche keys es gibt ?


Danke für Eure Hilfe

Back to de.comp.lang.python | Previous | NextNext in thread | Find similar


Thread

Argumente in Python-C-Extension parsen Guenther Sohler <guenther.sohler@gmail.com> - 2019-08-27 00:56 -0700
  Re: [Python-de] Argumente in Python-C-Extension parsen Stefan Behnel <python-de@behnel.de> - 2019-08-27 19:18 +0200
    Re: [Python-de] Argumente in Python-C-Extension parsen Guenther Sohler <guenther.sohler@gmail.com> - 2019-08-28 22:45 -0700
      Re: [Python-de] Argumente in Python-C-Extension parsen Hartmut Goebel <h.goebel@goebel-consult.de> - 2019-08-29 08:47 +0200

csiph-web