[Pyrex] [Mac Inter Core Duo OS 10.4.9 ] extern C class decl. requires module specification

David Goldsmith David.L.Goldsmith at noaa.gov
Thu Jun 14 17:23:41 UTC 2007


Lenard Lindstrom wrote:
> David Goldsmith wrote:
>   
>> Greg Ewing wrote:
>>   
>>     
>>> Oh, I see -- you're talking about a C++ class, not
>>> a Python class!
>>>
>>> You should declare this in Pyrex as a struct, not
>>> a class. If you use the word 'class', Pyrex thinks
>>> you're defining an extension type.
>>>
>>> Also be aware that Pyrex doesn't really know about
>>> C++ classes, and will treat it as though it were
>>> a C struct, so you won't be able to do all the things
>>> you could do with it in C++.
>>>     
>>>       
>> OK, so now I'm going to have to bone up on precisely what features 
>> classes support that structs don't (e.g., I used to think that member 
>> functions was on that list, then I learned that structs do support that; 
>> upon learning that, I just switched to classes, period, and abandoned 
>> structs altogether).
>>   
>>     
> C++ structures are classes that make their methods and members public by 
> default. 
Is that all?  No issues of inheritance?  Polymorphism?  Etc.?
> Declaring with class is a convention. A while back I wrote a 
> guide to using C++ from Pyrex. It was for a pre-Pyrex 0.9.5 patch but 
> should still be relevant.
>
> http://lists.copyleft.no/pipermail/pyrex/2006-April/001704.html
>   
Great, thanks!!!

DG
-- 
ERD/ORR/NOS/NOAA <http://response.restoration.noaa.gov/emergencyresponse/>



More information about the Pyrex mailing list