sage: is_triangular_number(0) 0 sage: is_triangular_number(1) 1 sage: is_triangular_number(2) False sage: is_triangular_number(3) 2
This is the same duck-typing style choice I made before. Example where unexpected output is generated: sage: [x for x in [0..3] if not is_triangular_number(x)] [0, 2] sage: [x for x in [0..3] if is_triangular_number(x)] [1, 3] The "not" coerces 0 into True, thereby keeping it in the list comprehension. Should I file a bug? Regards, Don -- 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