[Python-Dev] Recent experience with the _ast module (original) (raw)

Greg Ewing greg.ewing at canterbury.ac.nz
Thu Feb 15 02:01:27 CET 2007


Martin v. Löwis wrote:

switch(o) { case And: PyINCREF(Andsingleton); return Andsingleton; case Or: PyINCREF(Orsingleton); return Orsingleton;

Well, And_singleton and Or_singleton could be anything, including integers or interned strings. Creating a class and then a singleton instance for each one seems like overkill and unnecessary bloat to me.

-- Greg



More information about the Python-Dev mailing list