Turtle - make it possible to tilt image shape

I managed to work it out without any external dependencies - class with transformation seems to be like extra ~100 loc. Here is the code: https://github.com/python/cpython/compare/main…kbialowas:cpython:tilt-turtle-transformation

Entire setup looks like this, no need to create extra delegate classes etc.:

import turtle
import tkinter as tk
...
shape = turtle.Shape("transformable_image", tk.PhotoImage(file="./img.gif"))
sc.addshape("my_shape", shape)

t = turtle.Turtle()
t.shape("my_shape")
...
1 Like