Export IdSet interface to Python
1 unresolved thread
1 unresolved thread
Merge request reports
Activity
- dune/python/grid/idset.hh 0 → 100644
136 { 137 return registerSubId< Entity >( cls, PriorityTag< 42 >() ); 138 } 139 140 } // namespace detail 141 142 143 144 // registerGridIdSet 145 // ----------------- 146 147 template< class Grid, class IdSet, class... options > 148 inline static void registerGridIdSet ( pybind11::handle scope, pybind11::class_< IdSet, options... > cls ) 149 { 150 typedef detail::GridId< typename IdSet::IdType > Id; 151 auto id = insertClass< Id >( cls, "Id", GenerateTypeName( "Dune::Python::detail::GridId", GenerateTypeName( cls, "IdType" ) ) ); The Wrapper class ensures the type has not been registered to Python (it might be an int after all). This way, I am sure that all relevant methods are registered on the id (e.g.,
__hash__
,__str__
). Also, the Python user will never be surprised to find any extra method on the id (in case it really is an integer). Maybe, however, the GridId should be its own holder class.Edited by Martin Nolte
mentioned in commit b80ea608
Please register or sign in to reply