Re: [pygccxml-development] Indexing suite and Python containers
Brought to you by:
mbaas,
roman_yakovenko
From: Berserker <ber...@ho...> - 2010-01-20 08:17:49
|
> Did you consider the performance penalties? At least in my cases such > "marshaling" is very expensive and time consuming operation. If your > case is different you can solve the problem in a few ways: > * give a better name to the class "std_map_std_string_to_std_string" > * create "factory" : > def cppdict( type_ ): > if type_ == ( str, str ): > return std_map_std_string_to_std_string() > ... > m = cppdict( (str,str) ) > > * expose the functions under different name and create a function > wrapper in Python: > > from <your module> import foo_impl > > def foo( x ): > y = x > if isinstance( y, dict ): > y = std_map_std_string_to_std_string() > y.update( x ) > return foo_impl( x ) > > Basically, if you have many functions like that you can create a > function decorator, which converts arguments from one type to another. > > > Shouldn't indexing_suite do automatically this job? > > Strong no :-) Thanks for your response, I'll consider your suggestions. Bye _________________________________________________________________ Un mondo di personalizzazioni per Messenger, PC e cellulare http://www.pimpit.it/ |