This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author meador.inge
Recipients amaury.forgeotdarc, meador.inge, vladris
Date 2011-09-02.03:45:39
SpamBayes Score 1.593716e-06
Marked as misclassified No
Message-id <1314935140.41.0.152027374498.issue12764@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-09-02 03:45:40meador.ingesetrecipients: + meador.inge, amaury.forgeotdarc, vladris
2011-09-02 03:45:40meador.ingesetmessageid: <1314935140.41.0.152027374498.issue12764@psf.upfronthosting.co.za>
2011-09-02 03:45:39meador.ingelinkissue12764 messages
2011-09-02 03:45:39meador.ingecreate