Here's the explanation.  I had thought that check=False just stops the
check that the equations are satisfied (I posted an examples where
there were no equations which perhaps hid my point;  I found this
while constructing points on a curve in P^2).  But in fact it checks
nothing at all.

All I would want to do is change the line self._coords = v to
self._coords = list(v) at the appropriate place.  If that failed, then
it's the user's false.  In this case it did not fail and almost
everything worked, except that I got inconsistencies in sorting points
since the sort function tearted a point with _coords as list
differently from points with _coords as tuple!

John

On 5 February 2010 16:05, William Stein <wst...@gmail.com> wrote:
> On Fri, Feb 5, 2010 at 6:44 AM, John Cremona <john.crem...@gmail.com> wrote:
>> First example, nothing unexpected.  Note that P is created with a
>> tuple and Q with a list.
>>
>> sage: P2 = ProjectiveSpace(GF(2),2)
>> sage: P = P2.point((0,0,1))
>> sage: Q = P2.point([0,0,1])
>> sage: P
>> (0 : 0 : 1)
>> sage: Q
>> (0 : 0 : 1)
>> sage: P==Q
>> True
>> sage: P._coords
>> [0, 0, 1]
>> sage: Q._coords
>> [0, 0, 1]
>>
>>
>> Now the same but with "check=False":
>>
>> sage: P = P2.point((0,0,1),check=False)
>> sage: Q = P2.point([0,0,1],check=False)
>> sage: P
>> (0 : 0 : 1)
>> sage: Q
>> (0 : 0 : 1)
>> sage: P==Q
>> False
>> sage: P._coords
>> (0, 0, 1)
>> sage: Q._coords
>> [0, 0, 1]
>>
>> The point is that on creation of the point, valid tuple input is
>> converted to a list, unless check=False in which case tuples are left
>> as tuples.  This can result in wrong results.
>>
>> I know that users should only use "check=False" if they know what they
>> are doing!  This caught me out while writing a patch for #8193 (which
>> I used to show a new student the ropes, but testing it led us to this
>> weirdness!).  I suggest that the point-creation function takes the
>> trouble to always store _coords in a consistent way, presumably as a
>> list as at present (thought surely a tuple would be better?)
>
> I don't understand.  The entire point of check=False is to not check,
> and you're suggesting that check=False does check.   I'm confused
> despite your length explanation.   If you call a function with
> check=False and give invalid input, you shouldn't expect anything to
> work after that.  Maybe you want another option that isn't
> "check=False"?
>
>>
>> John
>>
>> --
>> To post to this group, send an email to sage-devel@googlegroups.com
>> To unsubscribe from this group, send an email to 
>> sage-devel+unsubscr...@googlegroups.com
>> For more options, visit this group at 
>> http://groups.google.com/group/sage-devel
>> URL: http://www.sagemath.org
>>
>
>
>
> --
> William Stein
> Associate Professor of Mathematics
> University of Washington
> http://wstein.org
>
> --
> To post to this group, send an email to sage-devel@googlegroups.com
> To unsubscribe from this group, send an email to 
> sage-devel+unsubscr...@googlegroups.com
> For more options, visit this group at 
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to