I like this idea, although having some kind of default caching scheme is also useful for people who just don't want to think about it.
-Dave On Jul 8, 2013, at 6:55 AM, "A.T.Hofkamp" <[email protected]> wrote: > On 07/08/2013 01:24 PM, David Beazley wrote: >> So, I was thinking about the PLY parsetab.py file this morning. What would >> people think if the >> data contained in this file was simply written somewhere in the system >> temporary directory (e.g., > > What about giving the user two extra methods > > 1. get_table_data() > Generates the parser data table, and returns it to the caller. Simplest > would be a string of some kind or so, ie a native data type easily handled if > you don't care about the contents. > > 2. set_table_data(data) > User provides the table data obtained from 1 at some point in the past. > > Also > > If no table has been provided before the first parse, generate the table > during the first parse internally. Just keep the table internally in memory, > during the life time of the praser object. > > > > This way people have complete freedom what they want to do (or don't want to > do) with the table data. I can see options like storing the table data in a > multi-line string literal in a generated Python file, or writing it in some > data file in the application, or whatever. > > -- > You received this message because you are subscribed to the Google Groups > "ply-hack" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ply-hack/51DAA89D.5010509%40tue.nl. > For more options, visit https://groups.google.com/groups/opt_out. > > -- You received this message because you are subscribed to the Google Groups "ply-hack" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ply-hack/6F346260-112D-4F06-9BD7-2F650CF39976%40dabeaz.com. For more options, visit https://groups.google.com/groups/opt_out.
