From: SourceForge.net <no...@so...> - 2004-10-08 12:02:42
|
Bugs item #1042458, was opened at 2004-10-07 21:03 Message generated for change (Comment added) made by wobsta You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442886&aid=1042458&group_id=45430 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Marcus Mendenhall (mendenhall) Assigned to: Nobody/Anonymous (nobody) Summary: Error with graph.data.list Initial Comment: In graph.data.list(), there are two places where PyX attempts to access the builtin list() function as __builtins__.list under certain conditions. This is not correct, since __builtins__ appears as a dictionary and has no list attribute, and throws an exception. If your _really must_ create a class with the name graph.data.list (which, because of the possible conflict with python's built-in list() function, especially if someone does from graph.data import * may be a bad idea), it is probably best to, at the top of graph.data, do something like builtin_list=list class list():... and then use a=builtin_list(...) where you currently use __builtins__.list(...) In general, though, I think it would be even better to rename this class to avoid some really mysterious behavior if anyone does do an import * from it. Marcus Mendenhall ---------------------------------------------------------------------- >Comment By: André Wobst (wobsta) Date: 2004-10-08 14:01 Message: Logged In: YES user_id=405853 I've just corrected the bug in the 0.6.x trunk. In CVS head this problem does not occur anymore, since the conversion of a sequence into a list is not necessary anymore. (Instead the new data handling allows for direct mixing of several data sources, which also removes some strange side effects.) Beside that I'm totally aware of the problem of the name "list". The name comes out of the following consitency consideration: Creating graph data from a file is done by data.file, creating data from out of a function is done by data.function, creating data from a different data is done by data.data ... so what's the name for creating data from a list of points? I thought data.list would be best here ... but feel free to suggest a different naming. We could do data.points, but I do not really like it. Feel free to convince me or suggest other possibilities. I do not stop at those changes currently since I classify PyX to still be in the design phase ... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442886&aid=1042458&group_id=45430 |