[sage-devel] Re: passing graphs by value

2009-08-03 Thread William Stein
On Mon, Aug 3, 2009 at 7:13 PM, Jason Grout wrote: > > Rado wrote: >> Let's try to divert the topic away from the embarrassing mistake i >> made:) >> >> For the graph editor I am still struggling with the update function, >> because the original graph variable name is lost once graph_editor is >>

[sage-devel] Re: passing graphs by value

2009-08-03 Thread Jason Grout
Rado wrote: > Let's try to divert the topic away from the embarrassing mistake i > made:) > > For the graph editor I am still struggling with the update function, > because the original graph variable name is lost once graph_editor is > called. > > python function graph_editor(g) gets the graph

[sage-devel] Re: passing graphs by value

2009-08-03 Thread Kwankyu
On Aug 4, 5:21 am, Rado wrote: > Hello, > > (I apologize if this has been discussed and it is a design decision). > I just noticed that graphs are passed by value instead of passed by > reference (which i think is standard in python). > > example: > > sage:def modify(G): > sage:    G=graphs.Com

[sage-devel] Re: passing graphs by value

2009-08-03 Thread Rado
ops, my bad ... and i thought i knew python :) Rado On Aug 3, 4:04 pm, Kwankyu wrote: > On Aug 4, 5:21 am, Rado wrote: > > > > > Hello, > > > (I apologize if this has been discussed and it is a design decision). > > I just noticed that graphs are passed by value instead of passed by > > refere

[sage-devel] Re: passing graphs by value

2009-08-03 Thread Rado
Let's try to divert the topic away from the embarrassing mistake i made:) For the graph editor I am still struggling with the update function, because the original graph variable name is lost once graph_editor is called. python function graph_editor(g) gets the graph representation and sends it

[sage-devel] Re: passing graphs by value

2009-08-03 Thread William Stein
On Mon, Aug 3, 2009 at 1:21 PM, Rado wrote: > > Hello, > > (I apologize if this has been discussed and it is a design decision). > I just noticed that graphs are passed by value instead of passed by > reference (which i think is standard in python). Graphs are pass by reference. Your function m