---
title: "Roach Zhao (@roachzhao) | Hashnode"
description: "Roach Zhao (@roachzhao) writes on Hashnode. Read their latest articles and follow their work."
url: "https://hashnode.com/@roachzhao"
---

@roachzhao

# Roach Zhao

@roachzhao · Joined November 2020

## Comments

[Thanks Miguel Brito !](https://hashnode.com/posts/everything-you-need-to-know-about-pythons-namedtuples/5f6e3f4fade1fb598d439946/comment/5fc39b5a4b7d527151c38274#reply-5fc4a50a0a072175ef2cebe5)

Reply · Article · Nov 30, 2020 · [Everything You Need to Know About Python's Namedtuples](https://hashnode.com/posts/everything-you-need-to-know-about-pythons-namedtuples/5f6e3f4fade1fb598d439946)

[Hi, could you tell me why I got error for optional attribute? >>> from dataclasses import dataclass >>> from typing import Optional >>> @dataclass ... class Color: ... r: float ... g: float ... b: float ... alpha: Optional\[float\] ... >>> blue = Color(r=0, g=0, b=255) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: \_\_init\_\_() missing 1 required positional argument: 'alpha' Thansk in advance!](https://hashnode.com/posts/everything-you-need-to-know-about-pythons-namedtuples/5f6e3f4fade1fb598d439946/comment/5fc39b5a4b7d527151c38274)

Comment · Article · Nov 29, 2020 · [Everything You Need to Know About Python's Namedtuples](https://hashnode.com/posts/everything-you-need-to-know-about-pythons-namedtuples/5f6e3f4fade1fb598d439946)
