# Should \`None\` defaults for optional arguments be discouraged?

**URL:** <https://discuss.python.org/t/should-none-defaults-for-optional-arguments-be-discouraged/23554>\
**Category:** Core Development\
**Created:** [February 5, 2023, 1:04pm UTC](https://discuss.python.org/t/should-none-defaults-for-optional-arguments-be-discouraged/23554 "2023-02-05T13:04:56Z")\
**Posts on this page:** 1\
**Showing post:** 21

<div class="post-metadata">

**Author:** ![CAM-Gerlach](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/cam-gerlach/32/3688_2.png) [@CAM-Gerlach](https://discuss.python.org/u/CAM-Gerlach)\
**Post date:** [February 8, 2023, 12:04am UTC](https://discuss.python.org/t/should-none-defaults-for-optional-arguments-be-discouraged/23554/21 "2023-02-08T00:04:32Z")

</div>

This can work both ways, though, as even if something is syntactically a `float`, `int`, etc (like using `0`, `-1`, or even `math.e` for a flag value, as some has proposed), semantically the meaning and behavior is a special case, different from that with any other `int`/`float`. Using `None` (or a dedicated sentinel type) ensures the syntax clearly communicates that this is a semantic special case, and can allows type checkers and other tools to statically verify it is being handled inside the function (or wrappers) and better introspect usage outside of it.

---

_[View the full topic](https://discuss.python.org/t/should-none-defaults-for-optional-arguments-be-discouraged/23554)._
