<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, May 22, 2013 at 9:18 PM, Carlos Nepomuceno <span dir="ltr"><<a href="mailto:carlosnepomuceno@outlook.com" target="_blank">carlosnepomuceno@outlook.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">________________________________<br>
> From: <a href="mailto:eliben@gmail.com">eliben@gmail.com</a><br>
[...]<br>
<div class="im">> I've found the following declaration in 'Objects/stringobject.c' but it<br>
> just defines _Py_InsertThousandsGrouping() as<br>
> _PyString_InsertThousandsGrouping():<br>
><br>
> "#define _Py_InsertThousandsGrouping _PyString_InsertThousandsGrouping"<br>
><br>
> I'm looking for the opposite!<br>
><br>
> No, you aren't :-)<br>
><br>
> #define _Py_InsertThousandsGrouping _PyString_InsertThousandsGrouping<br>
> #include "stringlib/localeutil.h"<br>
><br>
> Now look inside "stringlib/localeutil.h" and think what the<br>
> pre-processor does with the function definition having the #define<br>
> above.<br>
><br>
> Eli<br>
<br>
</div>lol I can see clearly now! :p<br>
<br>
That reminds me of "Which came first, the chicken or the egg?"<br>
<br>
Thank you! Somehow I got intrigued by such use...<br>
<br>
Do you know why they've put a lot of source code inside the header files?<br>
<div class=""><div class="h5">_______________________________________________<br><br></div></div></blockquote><div><br></div><div>This depends per use-case. Commonly, code is placed in header files in C to achieve some sort of C++-template-like behavior with the preprocessor. In particular, I think Objects/stringlib/formatter.h  does this. Note this comment near its top:<br>

<br>/* Before including this, you must include either:<br>   stringlib/unicodedefs.h<br>   stringlib/stringdefs.h<br><br>   Also, you should define the names:<br>   FORMAT_STRING<br>   FORMAT_LONG<br>   FORMAT_FLOAT<br>   FORMAT_COMPLEX<br>

   to be whatever you want the public names of these functions to<br>   be.  These are the only non-static functions defined here.<br>*/<br><br></div></div>Eli<br></div><div class="gmail_extra"><br><br></div></div>