Serhiy Storchaka added the comment:

Argument Clinic is used just for running the generating code and inlining the 
result. This is the simplest part of Argument Clinic and using it looks an 
overhead. Argument Clinic has other disadvantages:

* In any case you need a rule in Makefile, otherwise the generated code can 
became outdated.

* Generated code depends not just on the generator code, but on the code of the 
collections module.

* Even tiny change in the generating code, namedtuple implementation or 
Argument Clinic code could need regenerating generated code with different 
checksums.

My second idea, more general solution, was making namedtuple itself using 
external caching. This would add a benefit for all users of namedtuple without 
changing a user code or with minimal changes.

namedtuple itself can save a bytecode and a source in files (like Java creates 
additional .class files for internal classes) and use a bytecode if it is not 
outdated. Generalized import machinery could be used for supporting generated 
code in a sync.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28638>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to