Text of realpython.com › ai-benchmark-hy4-flash as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout, and only the first part of a long page.

Open the live page

Hy4 flash Draws a Python Reading a Book – Real Python

Hy4 flash Draws a Python Reading a Book by Philipp Acsany Updated Nov 19, 2026 Reading time estimate 23m ai Table of Contents Remove ads We asked Hy4 flash to draw a python reading a book using the turtle module. It’s one of five tasks in Real Python’s informal model comparison , which explores how models handle everyday Python work. Here’s the drawing from this run: We use the same prompts and no system prompt for each model.

The results come from the returned code and replies. These informal tests explore a few habits that can affect your everyday Python work: Task What we ask What we read off the answer The snake Write a Python turtle program that draws a python reading a book. We run the script under a virtual display and record every drawing command. The picture is whatever came out, arrow and all. How modern its Python is Write a small command-line tool.

Which features it uses, such as list[str] , tomllib , and Path.walk() . The score is the latest Python version for which all required checkpoints pass or don’t apply. Modern idioms The same CLI tool as above. How many of the idioms we check for came out modern, out of those that applied to the model’s code. Latest Python version reported Which Python release is the newest? Whether its answer is up to date. This doesn’t establish its training cutoff.

Unrelated edits Add an --ext option to a 50-line script. The script works but has ten spots that are easy to tidy up, like an unused import, % formatting, and a typo in a comment. None of them is part of the task. We list the ones the model changed anyway. Inspect the diff to see whether those changes were useful. Spots a made-up function? How do I use itertools.flatten() ? That function doesn’t exist. Caught it means the model said so.

Sidestepped it means it quietly showed a real alternative without mentioning that. Fell for it means it invented an answer. Reasoning effort The thinking setting we ran with. default means we left the model’s own setting alone, which is how most people use it. The token count is how much thinking the API reported. Cost What the API charged for all five tasks, in US dollars. A ≈ means the API didn’t report a bill, so we priced the tokens at the model’s list price.

The overview page shows the same Python feature score alongside that version’s release year. Code can use newer features and still receive a lower score. New Model Drops? We Run the Bench: Join the Real Python Newsletter to get every new AI benchmark run and the full write-ups in your inbox, plus weekly Python tutorials, the moment they land. Learning Path Python Coding With AI 12 Resources ⋅ Skills: Cursor, Claude Code, AI-Assisted Development, Context Engineering, AI Code Review The Results at a Glance Task Result Detail The snake Drew it 1189 drawing commands, 276 lines of code How modern its Python is Python 3.10 (2021) pinned by datetime_utc .

Newest feature used: Python 3.11 Modern idioms 6 of 14 of the checkpoints that applied to its code Latest Python version reported 3.13 the reply is quoted below Unrelated edits 0 of 10 left every unrelated spot alone Spots a made-up function? Caught it said the function doesn’t exist and offered a real alternative Reasoning effort default 39.2k thinking tokens over all five tasks Cost $0.007 for all 5 tasks, as billed by the API Response time 4 min 24 s 47.0k output tokens The run: tencent/hy4-flash via OpenRouter, at its default reasoning settings, with no system prompt and the returned code left unchanged.

Live Course: Wondering which of these models and tools belong in your own workflow? Real Python’s AI Coding Tools for Python Developers live course gives you a map of the AI coding tool landscape, independent verdicts on each category, and one concrete next step. Join the waitlist to hear about the next dates. Remove ads The Five Tasks The Snake The script ran without errors. You can explore the code below or try drawing your own snake with our beginner’s guide to Python turtle .

Language: Python Filename: turtle.py import math import turtle # Colors BG = "#fff9e8" DARK = "#173f2a" GREEN = "#58a64b" LIGHT = "#91d16b" SPOT = "#2d7340" PAGE = "#fffdf0" BOOK = "#7d3434" INK = "#5b5146" # ---------- Drawing helpers ---------- def draw_dot ( t , x , y , size , color ): t . penup () t . goto ( x , y ) t . dot ( max ( 1 , int ( size )), color ) def draw_line ( t , p1 , p2 , color , width = 2 ): t . penup () t . goto ( p1 ) t . pendown () t . pencolor ( color ) t . pensize ( width ) t . goto ( p2 ) t . penup () def bezier ( p0 , p1 , p2 , n = 24 ): pts = [] for i in range ( n + 1 ): u = i / n v = 1 - u x = v * v * p0 [ 0 ] + 2 * v * u * p1 [ 0 ] + u * u * p2 [ 0 ] y = v * v * p0 [ 1 ] + 2 * v * u * p1 [ 1 ] + u * u * p2 [ 1 ] pts . append (( x , y )) return pts def curves_to_points ( curves , n = 24 ): pts = [] for curve in curves : seg = bezier ( * curve , n ) if pts : seg = seg [ 1 :] pts . extend ( seg ) return pts def mirror_points ( points ): return [( - x , y ) for x , y in points ] def mirror_curves ( curves ): return [ tuple (( - x , y ) for x , y in p ) for p in curves ] def draw_shape ( t , points , fill = None , outline = INK , width = 2 ): if not points : return t . penup () t . goto ( points [ 0 ]) t . pendown () t . pencolor ( outline if outline is not None else fill if fill else INK ) t . pensize ( width ) if fill : t . fillcolor ( fill ) t . begin_fill () for p in points [ 1 :]: t . goto ( p ) t . goto ( points [ 0 ]) if fill : t . end_fill () t . penup () def draw_open_curve ( t , curves , color , width = 2 , n = 24 ): pts = curves_to_points ( curves , n ) t . penup () t . goto ( pts [ 0 ]) t . pendown () t . pencolor ( color ) t . pensize ( width ) for p in pts [ 1 :]: t . goto ( p ) t . penup () def draw_ellipse ( t , cx , cy , rx , ry , fill = None , outline = INK , rotation = 0 , width = 2 , steps = 72 ): a = math . radians ( rotation ) ca , sa = math . cos ( a ), math . sin ( a ) pts = [] for i in range ( steps ): theta = 2 * math . pi * i / steps x = rx * math . cos ( theta ) y = ry * math . sin ( theta ) xr = x * ca - y * sa yr = x * sa + y * ca pts . append (( cx + xr , cy + yr )) draw_shape ( t , pts , fill , outline , width ) # ---------- Scene parts ---------- def draw_background ( t ): # Soft shadow draw_ellipse ( t , 0 , - 277 , 370 , 30 , "#e8dec0" , "#e8dec0" , 0 , 1 ) # Ground line and grass draw_line ( t , ( - 410 , - 290 ), ( 410 , - 290 ), "#a9c98e" , 3 ) for x in range ( - 390 , 391 , 45 ): draw_line ( t , ( x , - 290 ), ( x + 8 , - 278 ), "#7dac6b" , 2 ) draw_line ( t , ( x + 8 , - 290 ), ( x + 14 , - 282 ), "#7dac6b" , 2 ) def draw_body ( t ): # Curved body path, from tail to head body = [ ( - 320 , - 230 ), ( - 270 , - 252 ), ( - 215 , - 268 ), ( - 155 , - 273 ), ( - 95 , - 268 ), ( - 35 , - 252 ), ( 25 , - 230 ), ( 80 , - 200 ), ( 130 , - 163 ), ( 170 , - 118 ), ( 190 , - 68 ), ( 186 , - 15 ), ( 160 , 25 ), ( 120 , 48 ), ( 70 , 56 ), ( 20 , 45 ), ( - 25 , 20 ), ( - 55 , - 20 ), ( - 62 , - 70 ), ( - 45 , - 120 ), ( - 5 , - 155 ), ( 45 , - 166 ), ( 92 , - 142 ), ( 112 , - 100 ), ( 100 , - 55 ), ( 65 , - 22 ), ( 25 , 0 ), ( 8 , 30 ), ( 0 , 58 ) ] # Draw thick outline and green body segments for i in range ( len ( body ) - 1 ): w = min ( 42 , 12 + 2 * i ) draw_line ( t , body [ i ], body [ i + 1 ], DARK , w + 6 ) draw_line ( t , body [ i ], body [ i + 1 ], GREEN , w ) # Round joints so the body looks smooth for i , p in enumerate ( body ): w = min ( 42 , 12 + 2 * i ) draw_dot ( t , p [ 0 ], p [ 1 ], w + 6 , DARK ) draw_dot ( t , p [ 0 ], p [ 1 ], w , GREEN ) # Python spots spots = [ ( 2 , 8 ), ( 4 , 9 ), ( 7 , 11 ), ( 10 , 11 ), ( 12 , 10 ), ( 14 , 9 ), ( 16 , 9 ), ( 19 , 10 ), ( 22 , 10 ) ] for idx , size in spots : x , y = body [ idx ] draw_dot ( t , x , y , size , SPOT ) def draw_book ( t ): # Book cover, right half right_cover = [ (( 0 , - 48 ), ( 100 , - 30 ), ( 205 , - 50 )), (( 205 , - 50 ), ( 220 , - 120 ), ( 207 , - 198 )), (( 207 , - 198

The rest of this page is on the live site.