<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd" -->

---
title: Right Types, Wrong Code: Surprising Bugs A Type Checker...
description: Pyrefly, Meta&#x27;s Python type checker, catches bugs beyond simple type mismatches by understanding code structure. Five real bug categories are covered:...
canonical: https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Right Types, Wrong Code: Surprising Bugs A Type Checker Catches | daily.dev
og:description: Pyrefly, Meta&#x27;s Python type checker, catches bugs beyond simple type mismatches by understanding code structure. Five real bug categories are covered:...
og:url: https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd
og:image: https://api.daily.dev/og/posts/RuAaRIdRD.png
og:image:alt: Right Types, Wrong Code: Surprising Bugs A Type Checker Catches
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Right Types, Wrong Code: Surprising Bugs A Type Checker Catches

**[Pyrefly: A Fast Python Type Checker and Language Server \| Pyrefly](https://daily.dev/sources/pyrefly)** · 4 min read · 0 upvotes · 0 comments

## Summary

Pyrefly, Meta's Python type checker, catches bugs beyond simple type mismatches by understanding code structure. Five real bug categories are covered: forgetting to await an async function (unused-coroutine), forgetting to call a function before checking its truthiness (redundant-condition), renaming an overridden method's parameter and breaking keyword-argument callers (bad-override-param-name), non-exhaustive match statements over enums (non-exhaustive-match), and using 'is' instead of isinstance to check a type (unnecessary-comparison). The piece argues type-aware analysis catches issues plain linters can't reliably detect.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://pyrefly.org/blog/surprising-errors>

## Questions this post answers

### Why does calling an async Python function without await silently fail to do anything?

Calling an async function without await creates a coroutine object that is never executed, so the code inside never runs; Python does not raise an exception, only a RuntimeWarning that is easy to miss in logs. The fix is to add await before the call, such as changing send_notification(user_id, message) to await send_notification(user_id, message).

_daily.dev surfaces practical Python gotchas like this for developers debugging silent async failures._

### Why is my Python if-statement checking a function always true even when the check should fail?

Writing a function name without parentheses, like 'if is_authorized:' instead of 'if is_authorized(user):', references the function object itself rather than calling it, and function objects are always truthy in Python. Static type checkers like Pyrefly flag this as a redundant-condition error since the condition can never evaluate to false.

_developers hunting elusive logic bugs can track type-checker findings like this via daily.dev._

### Why does renaming a parameter in an overridden Python method break existing callers?

If a subclass method renames a parameter compared to the base class method, callers that invoke the method using keyword arguments (like cache.get('x', default=None)) break when passed a subclass instance whose parameter is named differently, violating the Liskov Substitution Principle. Pyrefly detects this as a bad-override-param-name error even when the types otherwise match.

_teams weighing type-checker adoption can follow inheritance pitfalls like this on daily.dev._

## Similar posts on daily.dev

- [Pyrefly 1.0: A fast, forward-looking Python linter](https://daily.dev/posts/pyrefly-1-0-a-fast-forward-looking-python-linter-k4vukcqpr) · InfoWorld · 0 upvotes · 0 comments
- [What's type-coverage, and why should I care?](https://daily.dev/posts/what-s-type-coverage-and-why-should-i-care--br4v8jndh) · Pyrefly: A Fast Python Type Checker and Language Server \| Pyrefly · 0 upvotes · 0 comments
- [Python Type Checker Comparison: Typing Spec Conformance](https://daily.dev/posts/python-type-checker-comparison-typing-spec-conformance-yvjkxqkwd) · Hacker News · 1 upvotes · 0 comments

---

Tags: [#general-programming](https://daily.dev/tags/general-programming), [#python](https://daily.dev/tags/python)

[View this post on daily.dev](https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Right Types, Wrong Code: Surprising Bugs A Type Checker Catches","url":"https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd"},"datePublished":"2026-08-23T12:17:16.927Z","dateModified":"2026-08-23T12:20:51.240Z","description":"Pyrefly, Meta's Python type checker, catches bugs beyond simple type mismatches by understanding code structure. Five real bug categories are covered:...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ce7cceb523e1bdb0e6d2d6310d2d101d?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","logo":"https://media.daily.dev/image/upload/s--Qzw5NpnF--/c_limit,w_256/f_auto,q_auto/v1787487420/logos/pyrefly?_a=BAMAMicg0","url":"https://daily.dev/sources/pyrefly"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"general-programming,python","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Pyrefly: A Fast Python Type Checker and Language Server | Pyrefly","item":"https://daily.dev/sources/pyrefly"},{"@type":"ListItem","position":3,"name":"Right Types, Wrong Code: Surprising Bugs A Type Checker Catches"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/right-types-wrong-code-surprising-bugs-a-type-checker-catches-ruaaridrd#faq","mainEntity":[{"@type":"Question","name":"Why does calling an async Python function without await silently fail to do anything?","acceptedAnswer":{"@type":"Answer","text":"Calling an async function without await creates a coroutine object that is never executed, so the code inside never runs; Python does not raise an exception, only a RuntimeWarning that is easy to miss in logs. The fix is to add await before the call, such as changing send_notification(user_id, message) to await send_notification(user_id, message). daily.dev surfaces practical Python gotchas like this for developers debugging silent async failures."}},{"@type":"Question","name":"Why is my Python if-statement checking a function always true even when the check should fail?","acceptedAnswer":{"@type":"Answer","text":"Writing a function name without parentheses, like 'if is_authorized:' instead of 'if is_authorized(user):', references the function object itself rather than calling it, and function objects are always truthy in Python. Static type checkers like Pyrefly flag this as a redundant-condition error since the condition can never evaluate to false. developers hunting elusive logic bugs can track type-checker findings like this via daily.dev."}},{"@type":"Question","name":"Why does renaming a parameter in an overridden Python method break existing callers?","acceptedAnswer":{"@type":"Answer","text":"If a subclass method renames a parameter compared to the base class method, callers that invoke the method using keyword arguments (like cache.get('x', default=None)) break when passed a subclass instance whose parameter is named differently, violating the Liskov Substitution Principle. Pyrefly detects this as a bad-override-param-name error even when the types otherwise match. teams weighing type-checker adoption can follow inheritance pitfalls like this on daily.dev."}}]}
```

