MCPcopy Index your code
hub / github.com/python/cpython / dot

Method dot

Lib/turtle.py:3486–3527  ·  view source on GitHub ↗

Draw a dot with diameter size, using color. Optional arguments: size -- an integer >= 1 (if given) color -- a colorstring or a numeric color tuple Draw a circular dot with diameter size, using color. If size is not given, the maximum of pensize+4 and 2*pensi

(self, size=None, *color)

Source from the content-addressed store, hash-verified

3484 self._update()
3485
3486 def dot(self, size=None, *color):
3487 """Draw a dot with diameter size, using color.
3488
3489 Optional arguments:
3490 size -- an integer >= 1 (if given)
3491 color -- a colorstring or a numeric color tuple
3492
3493 Draw a circular dot with diameter size, using color.
3494 If size is not given, the maximum of pensize+4 and 2*pensize is used.
3495
3496 Example (for a Turtle instance named turtle):
3497 >>> turtle.dot()
3498 >>> turtle.fd(50); turtle.dot(20, "blue"); turtle.fd(50)
3499 """
3500 if not color:
3501 if isinstance(size, (str, tuple)):
3502 color = self._colorstr(size)
3503 size = self._pensize + max(self._pensize, 4)
3504 else:
3505 color = self._pencolor
3506 if not size:
3507 size = self._pensize + max(self._pensize, 4)
3508 else:
3509 if size is None:
3510 size = self._pensize + max(self._pensize, 4)
3511 color = self._colorstr(color)
3512 # If screen were to gain a dot function, see GH #104218.
3513 pen = self.pen()
3514 if self.undobuffer:
3515 self.undobuffer.push(["seq"])
3516 self.undobuffer.cumulate = True
3517 try:
3518 if self.resizemode() == 'auto':
3519 self.ht()
3520 self.pendown()
3521 self.pensize(size)
3522 self.pencolor(color)
3523 self.forward(0)
3524 finally:
3525 self.pen(pen)
3526 if self.undobuffer:
3527 self.undobuffer.cumulate = False
3528
3529 def _write(self, txt, align, font):
3530 """Performs the writing for write()

Callers 1

test_dot_signatureMethod · 0.80

Calls 8

_colorstrMethod · 0.95
penMethod · 0.80
resizemodeMethod · 0.80
pendownMethod · 0.80
pensizeMethod · 0.80
pencolorMethod · 0.80
pushMethod · 0.45
forwardMethod · 0.45

Tested by 1

test_dot_signatureMethod · 0.64