# Differences in bound=object vs bound=Any

**URL:** <https://discuss.python.org/t/differences-in-bound-object-vs-bound-any/27052>\
**Category:** Python Help\
**Tags:** help\
**Created:** [May 24, 2023, 4:14pm UTC](https://discuss.python.org/t/differences-in-bound-object-vs-bound-any/27052 "2023-05-24T16:14:11Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![duncanb](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/duncanb/32/4153_2.png) [@duncanb](https://discuss.python.org/u/duncanb)\
**Post date:** [May 26, 2023, 11:29am UTC](https://discuss.python.org/t/differences-in-bound-object-vs-bound-any/27052/6 "2023-05-26T11:29:36Z")

</div>

Type systems often look at types as though they exist in a hierarchy from top to bottom. Types can be silently converted or assigned up the tree but not down.

In Python `object` is what is known as a top type: you can assign anything to a variable of type `object` but the only operations you can perform on that variable are the operations valid on all objects.

The `Any` type is both a top type (so you can assign anything to `Any`) and a bottom type (so you can assign `Any` to anything). In effect it turns off the type system whenever you use `Any`.

If you know any typescript there the equivalents are `object` and `unknown` are top types (but `unknown` has no operations at all defined on it), `never` is a bottom type (so no other types can be assigned to a `never`) and `any` is both top and bottom so again effectively breaks the type system.

As of Python 3.11 we also have a proper bottom type in `typing.Never`. I’m not aware if we have an equivalent `unknown` type but for most purposes using `object` will do (and `object` is almost always preferable in places people use `typing.Any`).

So to answer the question, `bound=Any` is removing all the safety harnesses you want if you’re doing typing at all in Python, `bound=object` keeps the safety but does mean you will have to explicitly check the actual type if you want to do anything much with the object.

---

_[View the full topic](https://discuss.python.org/t/differences-in-bound-object-vs-bound-any/27052)._
