You probably want deepcopy.  That being said, Q.vertices should probably
also make a copy before returning the result.
David

On Thu, Apr 11, 2019 at 1:48 AM Narayanan Narayanan <naray...@gmail.com>
wrote:

>
> I have recently created a Polyhedron Q  that corresponts to the cuts of a
> graph.
>
> Once I have Q, I created a list of vectors of its vertices as follows:
>
> V=[s.vector() for s in Q.vertices()]
>
> Now I create a copy of V
> W= copy(V)
>
> Then I change the 6th co-ordinate of each vector in W as follows
>
> for i in range(len(W)) :
>      W[i][5]=0
>
> That is when all the hell broke lose.
>
> The change reflected in V  also (all vectors of V had now 6th coordinate 0)
>
> But that is not the shocking part: call to Q.vertices() now returns
> vertices where all have 6th coordinate 0!
>
> Can someone explain what is going on?
>
> Narayanan
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to sage-devel+unsubscr...@googlegroups.com.
> To post to this group, send email to sage-devel@googlegroups.com.
> Visit this group at https://groups.google.com/group/sage-devel.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sage-devel+unsubscr...@googlegroups.com.
To post to this group, send email to sage-devel@googlegroups.com.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.

Reply via email to