# AC: \`NULL\` defaults prevent correct signatures. Let's add \`inspect.unrepresentable\` to fix this

**URL:** <https://discuss.python.org/t/ac-null-defaults-prevent-correct-signatures-lets-add-inspect-unrepresentable-to-fix-this/30753>\
**Category:** Core Development\
**Created:** [August 1, 2023, 9:26am UTC](https://discuss.python.org/t/ac-null-defaults-prevent-correct-signatures-lets-add-inspect-unrepresentable-to-fix-this/30753 "2023-08-01T09:26:45Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![Jelle](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/jelle/32/1049_2.png) [@Jelle](https://discuss.python.org/u/Jelle)\
**Post date:** [November 9, 2023, 4:31pm UTC](https://discuss.python.org/t/ac-null-defaults-prevent-correct-signatures-lets-add-inspect-unrepresentable-to-fix-this/30753/10 "2023-11-09T16:31:36Z")

</div>

I ran into this problem too because the tool we use to verify function signatures in typeshed relies on `inspect.signature`, which fails on these “`<unrepresentable>`” defaults. I proposed [a hacky solution](https://github.com/python/mypy/pull/16433), but it would be better if the `inspect` module supported these signatures directly.

I would favor Nikita’s suggested solution of adding a marker like `inspect.unrepresentable` (I’d vote for exposing it as `inspect.Parameter.unrepresentable`, similar to `.empty`). @storchaka objects that this might break tools that assume something like `iter(object, inspect.unrepresentable)` would work. But it’s not unexpected for such tools that inspect signatures to have to adapt to new features in new Python versions (e.g., positional-only parameters). I help maintain several tools that rely on `inspect.signature`, and I’d much prefer if they could support unrepresentable defaults, even if that means I have to make some changes to support Python 3.13.

There is an alternative suggestion to support “multi-signatures”. That would be a good solution for some functions like `iter`, but for other cases like `bytes.hex`, I don’t think that solution is more elegant. It also adds significantly more complexity.

---

_[View the full topic](https://discuss.python.org/t/ac-null-defaults-prevent-correct-signatures-lets-add-inspect-unrepresentable-to-fix-this/30753)._
