# Class-like syntax for union type aliases and natural docstrings

**URL:** <https://discuss.python.org/t/class-like-syntax-for-union-type-aliases-and-natural-docstrings/109103>\
**Category:** Ideas\
**Tags:** typing\
**Created:** [September 17, 2026, 11:11pm UTC](https://discuss.python.org/t/class-like-syntax-for-union-type-aliases-and-natural-docstrings/109103 "2026-09-17T23:11:06Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Monarch](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/monarch/32/18530_2.png) [@Monarch](https://discuss.python.org/u/Monarch)\
**Post date:** [September 28, 2026, 8:54pm UTC](https://discuss.python.org/t/class-like-syntax-for-union-type-aliases-and-natural-docstrings/109103/14 "2026-09-28T20:54:24Z")

</div>

> [@mjmikulski](#):
>
> @Monarch, you wrote in another thread:
> 
> > Tangential: I really dislike `type name = value`. I much prefer Python’s `name: type = value` (same for Rust, TypeScript, Kotlin, etc)
> 
> I’d be curious what you think of my idea. I also feel that `type name = value` is a bit c++ish rather than pythonic 😉

That was in the context of the thread proposing C-like _variable annotation_ syntax such as `int foo = 10`. That’s what I meant when I said I disliked `type name = value`.

I later clarified this because someone else had the same confusion, evidently my phrasing was pretty poor!

> [@Alternative type-first annotation syntax: type: name = value](https://discuss.python.org/t/alternative-type-first-annotation-syntax-type-name-value/109156/10):
>
> I didn’t realize my comment could get confused for the `type` statement. I’m a big fan of the type statement in Python.

As for the _type statement_ itself, I have no issues with the current syntax. It also seems to be the convention in several other modern languages:

```plaintext
Rust: type Result<T> = ...;
TypeScript: type Result<T> = ...;
Go: type Result[T any] = ...;
Python: type Result[T] = ...

```

---

_[View the full topic](https://discuss.python.org/t/class-like-syntax-for-union-type-aliases-and-natural-docstrings/109103)._
