Opened 10 years ago

Last modified 10 years ago

#7153 new Feature Requests

it is not possible to add methods in enum_ using def

Reported by: tokiloki7@… Owned by: Ralf W. Grosse-Kunstleve
Milestone: To Be Determined Component: python USE GITHUB
Version: Boost 1.51.0 Severity: Problem
Keywords: Cc:

Description

Sometimes it is required to add method to exported enum to Python using Boost.Python. For example, if we want to specify repr method to enum. But the following code wont work.

enum_<my_enum>("my_enum")

.def("repr", &my_enum_to_string) ;

Change History (3)

comment:1 by Ralf W. Grosse-Kunstleve, 10 years ago

Is this a documented feature?

comment:2 by anonymous, 10 years ago

No, it is not documented feature.

comment:3 by Ralf W. Grosse-Kunstleve, 10 years ago

Type: BugsFeature Requests

changing to feature request; if you don't want to work on this yourself you may want to post to the Python C++-SIG to find a volunteer

Note: See TracTickets for help on using tickets.