[ty] Optimize and simplify some object-related code (#22366)

## Summary

I wondered if this might improve performance a little. It doesn't seem
to, but it's a net reduction in LOC and I think the changes make sense.
I think it's worth it anyway just in terms of simplifying the code.

## Test Plan

Our existing tests all pass and the primer report is clean (aside from
our usual flakes).
This commit is contained in:
Alex Waygood
2026-01-07 08:35:26 +00:00
committed by GitHub
parent 2190fcebe0
commit 5933cc0101
5 changed files with 15 additions and 17 deletions

View File

@@ -32,6 +32,7 @@ typeshed = "/typeshed"
`/typeshed/stdlib/builtins.pyi`:
```pyi
class object: ...
class Custom: ...
custom_builtin: Custom