Title: Checking Types Explicitly: Code (Video) – Real Python
Open Graph Title: Checking Types Explicitly: Code – Real Python
Description: Okay, so the first thing that you can try is the isinstance() function. This way, you’ll only be using the swim() method if the bird in question is a duck. So for bird in birds, if isinstance(bird,` Duck), meaning if the bird you’re looping through…
Open Graph Description: Okay, so the first thing that you can try is the isinstance() function. This way, you’ll only be using the swim() method if the bird in question is a duck. So for bird in birds, if isinstance(bird,` Duck), meaning if the bird you’re looping through…
Opengraph URL: https://realpython.com/lessons/checking-types-explicitly-code/
X: @realpython
Domain: realpython.com
{
"@context": "https://schema.org",
"@type": "VideoObject",
"name": "Checking Types Explicitly: Code",
"description": "Okay, so the first thing that you can try is the isinstance() function. This way, you’ll only be using the swim() method if the bird in question is a duck. So for bird in birds, if isinstance(bird,\u0060 Duck), meaning if the bird you’re looping through…",
"thumbnailUrl": ["https://files.realpython.com/media/Duck-Typing-in-Python_Watermarked.b1b2472a1e39.jpg"],
"uploadDate": "2025-03-11T14:00:00+00:00",
"duration": "PT1M38S",
"potentialAction": {
"@type": "SeekToAction",
"target": "https://realpython.com/lessons/checking-types-explicitly-code/#t={seek_to_second_number}",
"startOffset-input": "required name=seek_to_second_number"
}
}
| author | Real Python |
| theme-color | #18354c |
| color-scheme | light dark |
| twitter:card | summary_large_image |
| twitter:image | https://files.realpython.com/media/Duck-Typing-in-Python_Watermarked.b1b2472a1e39.jpg |
| og:image | https://files.realpython.com/media/Duck-Typing-in-Python_Watermarked.b1b2472a1e39.jpg |
| twitter:creator | @realpython |
| og:type | video.episode |
| og:site_name | Real Python |
| apple-mobile-web-app-title | Real Python |
Links:
Viewport: width=device-width, initial-scale=1, shrink-to-fit=no, viewport-fit=cover
Robots: max-image-preview:large