Meador Inge <mead...@gmail.com> added the comment:

Vlad,

Thanks for the patch.  A few nits:

   1. The test case is in 'test_bitfields.py'.
      I think it should go in 'test_structures.py'.

   2. The test case would probably be cleaner using a 'with' context
      manager:

         with self.assertRaises(TypeError):
               class S(Structure):
                   _fields_ = [(b"x", c_int)]

      A few more test cases might be nice too.

   3. The TypeError message display something like:

      "structure field name must be string not bytes"

      maybe the following would be more understandable:

      "field name must be an object of type str not bytes"

   4. The 'ptr', 'len', and 'buf' initializers are unnecessary.

Otherwise, looks good.

----------
nosy: +meadori
stage:  -> patch review
versions: +Python 3.3, Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue12764>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to