Re: [pygccxml-development] FT -subst_t
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-10-09 05:58:43
|
On 10/8/06, Matthias Baas <ba...@ir...> wrote: > Roman Yakovenko wrote: > > I don't understand why derived class code_manager_t should have ugly variable > > names: ARG_LIST_DEF, ARG_LIST_TYPES and etc. This is not coding convention > > of Py++. > > I was using upper case variables for sort of "low level" variables that > are usually initialized by corresponding lower case variables. > From the > point of view of the function transformer class these variables can be > regarded as internal variables that the transformers usually don't get > in touch with. > But from the point of view of the code creator these are the variables > that it has to use for substitution. I don't understand "low level" variables. If I understand the code right you have these variables and few methods that modifies them, right? So what is "low level" in this? This pattern is widely used in Py++. > > This class uses hard coded \n character. This is a mistake. It should use > > os.linesep character. > > Of course, I have no objections if you use os.linesep in your code, but > I just wanted to let you know that it doesn't really make a difference. > The following was executed in a Python shell under Windows: > > >>> f=file("delme.txt", "wt") > >>> f.write("\n") > >>> f.close() > >>> file("delme.txt", "rb").read() > '\r\n' > > Under Linux the same sequence would result in '\n'. So you see, at least > on Windows and Linux, the string "\n" is properly translated into a > native newline. You are using here universal line separator. First of I read somewhere that this feature will be deprecated. Second in next release Py++ will write text files using "codecs" module. This should be done in order to introduce documentation in different encodings. I could be wrong, but this module opens files in a binary mode, so this code will not work. > As to the rest of your mail, I'd rather like to begin at the top instead > of the bottom and see if we can get to a consensus about the API that > function transformer classes can access. I read the rest of the mail. Trust me, I understand your idea. Please answer the question I post in the initial mail. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |