mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 16:07:30 +03:00 
			
		
		
		
	Merge pull request #7640 from radarhere/type_hints
Added type hints to selftest.py, docs/conf.py and docs/example/anchors.py
This commit is contained in:
		
						commit
						d4fd04982a
					
				|  | @ -233,7 +233,7 @@ htmlhelp_basename = "PillowPILForkdoc" | ||||||
| 
 | 
 | ||||||
| # -- Options for LaTeX output --------------------------------------------- | # -- Options for LaTeX output --------------------------------------------- | ||||||
| 
 | 
 | ||||||
| latex_elements = { | latex_elements: dict[str, str] = { | ||||||
|     # The paper size ('letterpaper' or 'a4paper'). |     # The paper size ('letterpaper' or 'a4paper'). | ||||||
|     # 'papersize': 'letterpaper', |     # 'papersize': 'letterpaper', | ||||||
|     # The font size ('10pt', '11pt' or '12pt'). |     # The font size ('10pt', '11pt' or '12pt'). | ||||||
|  |  | ||||||
|  | @ -5,7 +5,7 @@ from PIL import Image, ImageDraw, ImageFont | ||||||
| font = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 16) | font = ImageFont.truetype("Tests/fonts/NotoSans-Regular.ttf", 16) | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def test(anchor): | def test(anchor: str) -> Image.Image: | ||||||
|     im = Image.new("RGBA", (200, 100), "white") |     im = Image.new("RGBA", (200, 100), "white") | ||||||
|     d = ImageDraw.Draw(im) |     d = ImageDraw.Draw(im) | ||||||
|     d.line(((100, 0), (100, 100)), "gray") |     d.line(((100, 0), (100, 100)), "gray") | ||||||
|  |  | ||||||
|  | @ -15,7 +15,7 @@ except AttributeError: | ||||||
|     pass |     pass | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| def testimage(): | def testimage() -> None: | ||||||
|     """ |     """ | ||||||
|     PIL lets you create in-memory images with various pixel types: |     PIL lets you create in-memory images with various pixel types: | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user