>> -def msg_str_attr(msg, buf, attr_list): >> +def msg_str_attr(msg, buf, attr_list=None): >> + if attr_list is None: >> + exclude = ['_attributes'] >> + try: >> + exclude += msg._attributes >> + except AttributeError: >> + pass >> + attr_list = set(dir(msg)) - set(exclude) > > Clever trick. > Is the result of str(msg) non-deterministic depending on the internal hash?
it depends on the implementation of set, yes. YAMAMOTO Takashi > > thanks, > > >> for attr in attr_list: >> val = getattr(msg, attr, None) >> if val is not None: ------------------------------------------------------------------------------ Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. This 200-page book is written by three acclaimed leaders in the field. The early access version is available now. Download your free book today! http://p.sf.net/sfu/neotech_d2d_may _______________________________________________ Ryu-devel mailing list Ryu-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ryu-devel