Document `turtle.teleport(v)` behaviour, which differs from `turtle.goto(v)`

turtle.goto(v) with single argument requires v to be a coordinate pair or Vec2D, and then makes the turtle go there.
turtle.teleport(v) (added in 3.12) with single argument requires v to be a value, and then only changes the X coordinate (leaving Y unchanged).
The latter is undocumented, making the reader assume it works like goto, and running into a rather cryptic error message if passing a coordinate pair.

I suggest explaining better.

3 Likes

The documentation seems OK to me. It even has that case in the examples.

What I do see unfortunate is that teleport did not implement the case of x being a tuple.

3 Likes

What’s odd is that help(turtle.teleport) shows documentation that doesn’t appear in the online docs:

call: teleport(x, y)         # two coordinates
--or: teleport(x)            # teleport to x position, keeping y as is
--or: teleport(y=y)          # teleport to y position, keeping x as is
--or: teleport(x, y, fill_gap=True)
                             # teleport but fill the gap in between
1 Like