---
title: "Comment by Joshua Blake on \"Luxurious Life Of First Class Python Functions\" | Hashnode"
description: "Can you elaborate on the use cases of Nested Functions?"
url: "https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8/comment/5ffeb39dc162d710c9b13bed"
---

[Discussion](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8)

Comment [Luxurious Life Of First Class Python Functions](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8)

[Joshua Blake](https://hashnode.com/@JB41)

[Jan 13, 2021](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8/comment/5ffeb39dc162d710c9b13bed)

Can you elaborate on the use cases of Nested Functions?

[Aagam Sheth](https://hashnode.com/@AagamSheth)

[Jan 13, 2021](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8/comment/5ffeb39dc162d710c9b13bed#reply-5ffeb73bb00f7510ee95907a)

More of a design pattern than use case. The best use case of nested function is a decorator. Other use cases can include limiting scope inside a function or splitting a function into sub inner functions if statements are repeated and recursion is not possible.

[Aagam Sheth](https://hashnode.com/@AagamSheth)

[Jan 13, 2021](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8/comment/5ffeb39dc162d710c9b13bed#reply-5ffeb7a3c162d710c9b13c66)

I will soon be writing a article on decorators. The are really useful. I use them most in Django for extending my views.

Also to define a Data Class in python a decorator is used.

[Joshua Blake](https://hashnode.com/@JB41)

[Jan 13, 2021](https://hashnode.com/posts/luxurious-life-of-first-class-python-functions/5ffeb17db00f7510ee958ee8/comment/5ffeb39dc162d710c9b13bed#reply-5ffebb0eb00f7510ee9590cb)

[Aagam Sheth](https://hashnode.com/@AagamSheth) Yes that would be great.
