Prev: Python/HTML integration: phileas v0.3 released
Next: scanning under windows WIA with custom settings (dpi / etc )
From: Carl Banks on 4 Dec 2009 17:41 On Dec 4, 12:46 pm, geremy condra <debat...(a)gmail.com> wrote: more common than full-blown graph package). > Sure, its a tree, which is also a graph. In this case it looks to > me more like a directed acyclic graph than anything, but its > pretty much just semantics since the interface is functionally > equivalent. I'd have to agree with Lie, yes a tree is a graph, but it's simply not an argument that Python community is grasping for graph structures. It's like arguing that the Python community could benefit from a quaternion type, because quaternions are actually heavily used in Python, because a scalar number is a quarternion. Carl Banks (Would be +1 on a good graph implementation... just not because of ElementTree.)
From: Lie Ryan on 4 Dec 2009 19:42 On 12/5/2009 9:41 AM, Carl Banks wrote: > On Dec 4, 12:46 pm, geremy condra<debat...(a)gmail.com> wrote: > more common than full-blown graph package). >> Sure, its a tree, which is also a graph. In this case it looks to >> me more like a directed acyclic graph than anything, but its >> pretty much just semantics since the interface is functionally >> equivalent. > > I'd have to agree with Lie, yes a tree is a graph, but it's simply not > an argument that Python community is grasping for graph structures. > It's like arguing that the Python community could benefit from a > quaternion type, because quaternions are actually heavily used in > Python, because a scalar number is a quarternion. > > Carl Banks > > (Would be +1 on a good graph implementation... just not because of > ElementTree.) I think this could be an interpretation of the Zen: Simple is better than complex. Complex is better than complicated. can be read as: List is better than Tree Tree is better than Graph not having Tree and Graph package in the standard library force most people to find List-based solution. And people that know they need graphs will find them in 3rd party modules. I have needed Trees a few times in python, but very rarely a Graph (except for playing around). YMDWV (your mileage definitely will vary).
From: geremy condra on 4 Dec 2009 20:26 On Fri, Dec 4, 2009 at 5:41 PM, Carl Banks <pavlovevidence(a)gmail.com> wrote: > On Dec 4, 12:46 pm, geremy condra <debat...(a)gmail.com> wrote: > more common than full-blown graph package). >> Sure, its a tree, which is also a graph. In this case it looks to >> me more like a directed acyclic graph than anything, but its >> pretty much just semantics since the interface is functionally >> equivalent. > > I'd have to agree with Lie, yes a tree is a graph, but it's simply not > an argument that Python community is grasping for graph structures. > It's like arguing that the Python community could benefit from a > quaternion type, because quaternions are actually heavily used in > Python, because a scalar number is a quarternion. Fair enough. I suspect that other examples could be provided easily enough that I'm not going to fight over that one. > Carl Banks > > (Would be +1 on a good graph implementation... just not because of > ElementTree.) I'd love it if you'd take a look at Graphine and see whether it would meet the standard for a good graph implementation. Geremy Condra
From: Carl Banks on 4 Dec 2009 20:38 On Dec 4, 4:42 pm, Lie Ryan <lie.1...(a)gmail.com> wrote: > On 12/5/2009 9:41 AM, Carl Banks wrote: > > > > > > > On Dec 4, 12:46 pm, geremy condra<debat...(a)gmail.com> wrote: > > more common than full-blown graph package). > >> Sure, its a tree, which is also a graph. In this case it looks to > >> me more like a directed acyclic graph than anything, but its > >> pretty much just semantics since the interface is functionally > >> equivalent. > > > I'd have to agree with Lie, yes a tree is a graph, but it's simply not > > an argument that Python community is grasping for graph structures. > > It's like arguing that the Python community could benefit from a > > quaternion type, because quaternions are actually heavily used in > > Python, because a scalar number is a quarternion. > > > Carl Banks > > > (Would be +1 on a good graph implementation... just not because of > > ElementTree.) > > I think this could be an interpretation of the Zen: > > Simple is better than complex. > Complex is better than complicated. > > can be read as: > List is better than Tree > Tree is better than Graph > > not having Tree and Graph package in the standard library force most > people to find List-based solution. And people that know they need > graphs will find them in 3rd party modules. I have needed Trees a few > times in python, but very rarely a Graph (except for playing around). > YMDWV (your mileage definitely will vary). If you want a better example, consider various database schemas that have one-to-one, one-to-many, many-to-one, and many-to-many relationships. I daresay these are very common. All of these can be represented by a non-directed graph. Another common use of directed graphs is for dependency relationships. In practice, a lot of times running things in order of dependency is done by assigning everything a scalar priotity, and executing in order of priority. This can work ok, but it's fragile. If there's a graph type in Python maybe people will be encouraged to handle dependencies explicitly. Carl Banks
From: geremy condra on 4 Dec 2009 20:38
On Fri, Dec 4, 2009 at 7:42 PM, Lie Ryan <lie.1296(a)gmail.com> wrote: > On 12/5/2009 9:41 AM, Carl Banks wrote: >> >> On Dec 4, 12:46 pm, geremy condra<debat...(a)gmail.com> wrote: >> more common than full-blown graph package). >>> >>> Sure, its a tree, which is also a graph. In this case it looks to >>> me more like a directed acyclic graph than anything, but its >>> pretty much just semantics since the interface is functionally >>> equivalent. >> >> I'd have to agree with Lie, yes a tree is a graph, but it's simply not >> an argument that Python community is grasping for graph structures. >> It's like arguing that the Python community could benefit from a >> quaternion type, because quaternions are actually heavily used in >> Python, because a scalar number is a quarternion. > >> >> >> Carl Banks >> >> (Would be +1 on a good graph implementation... just not because of >> ElementTree.) > > I think this could be an interpretation of the Zen: > > Simple is better than complex. > Complex is better than complicated. > > can be read as: > List is better than Tree > Tree is better than Graph > > not having Tree and Graph package in the standard library force most people > to find List-based solution. And people that know they need graphs will find > them in 3rd party modules. I have needed Trees a few times in python, but > very rarely a Graph (except for playing around). YMDWV (your mileage > definitely will vary). Where a list will do, use a list- duh. But when you need a graph, you shouldn't have to homebrew an implementation any more than you should have to homebrew an odict or named tuple, both of which are substantially easier to get right than a graph is. Geremy Condra |