[PATCH 3 of 3] inotify extension: Port of the C module to py3k
Antoine Pitrou
solipsis at pitrou.net
Thu Jun 17 10:49:04 CDT 2010
Renato Cunha <renatoc <at> gmail.com> writes:
>
> On Thu, Jun 17, 2010 at 11:37:39AM +0000, Antoine Pitrou wrote:
> > repr() should really return a str object under 3.x, not a bytes one. So you
have
> > to use PyString_FromString for 2.x, and PyUnicode_FromString for 3.x.
> > (perhaps you want another set of #define's)
>
> What about defining PyString as a PyUnicode equivalent in the py3k section in
> util.h?
>
> Then, PyBytes* could be used for byte strings and PyString (being PyUnicode in
> py3k) for the other.
This looks reasonable.
One thing to be careful about is to not let uses of PyString slip through where
bytes objects would be natural in 3.x (mostly, binary data).
Regards
Antoine.
More information about the Mercurial-devel
mailing list