title: exposing method with unsigned char & argument using Boost.Python
body: <p>I've closed-source C++ library, which provides header files with code equivalent to:</p>
  
  <pre><code>class CSomething
  {
    public:
        void getParams( unsigned char &amp; u8OutParamOne, 
                        unsigned char &amp; u8OutParamTwo ) const;
    private:
        unsigned char u8OutParamOne_,
        unsigned char u8OutParamTwo_,
  };
  </code></pre>
  
  <p>I'm trying to expose that to Python, my wrapper code is something like this:</p>
  
  <pre><code>BOOST_PYTHON_MODULE(MySomething)
  {
      class_&lt;CSomething&gt;("CSomething", init&lt;&gt;())
          .def("getParams", &amp;CSomething::getParams,(args("one", "two")))
  
  }
  </code></pre>
  
  <p>Now I'm trying to use that in Python, which fails horribly:</p>
  
  <pre><code>one, two = 0, 0
  CSomething.getParams(one, two)
  </code></pre>
  
  <p>Which results in:</p>
  
  <pre><code>ArgumentError: Python argument types in
      CSomething.getParams(CSomething, int, int)
  did not match C++ signature:
      getParams(CSomething {lvalue}, unsigned char {lvalue} one, unsigned char {lvalue} two)
  </code></pre>
  
  <p>What do I need to change either in the Boost.Python wrapper code or Python code to make it work? How do I add some Boost.Python magic to automatically cast <code>PyInt</code> to <code>unsigned char</code> and vice-versa?</p>