mirror of
https://github.com/boostorg/python.git
synced 2026-01-24 18:12:43 +00:00
enum export
[SVN r16604]
This commit is contained in:
@@ -19,6 +19,7 @@ BOOST_PYTHON_MODULE(enum_ext)
|
||||
.value("red", red)
|
||||
.value("green", green)
|
||||
.value("blue", blue)
|
||||
.export_values()
|
||||
;
|
||||
|
||||
def("identity", identity_);
|
||||
|
||||
11
test/enum.py
11
test/enum.py
@@ -20,6 +20,17 @@ enum_ext.color.green
|
||||
enum_ext.color(3)
|
||||
|
||||
>>> identity(color(4))
|
||||
enum_ext.color.blue
|
||||
|
||||
--- check export to scope ---
|
||||
|
||||
>>> identity(red)
|
||||
enum_ext.color.red
|
||||
|
||||
>>> identity(green)
|
||||
enum_ext.color.green
|
||||
|
||||
>>> identity(blue)
|
||||
enum_ext.color.blue
|
||||
|
||||
>>> try: identity(1)
|
||||
|
||||
Reference in New Issue
Block a user