---
title: "Discussion on \"[Python] How Closures and Decorators in Python Work Together to Simplify Code\" | Hashnode"
description: "Discussion on \"[Python] How Closures and Decorators in Python Work Together to Simplify Code\". A closure is created when a function (the inner function) is defined within another function (the outer function) and the inner function references variable"
url: "https://hashnode.com/posts/closures-and-decoators/67643383544e27c461a19271"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [\[Python\] How Closures and Decorators in Python Work Together to Simplify Code](https://jaylog.hashnode.dev/closures-and-decoators?utm_source=hashnode&utm_medium=feed)

A closure is created when a function (the inner function) is defined within another function (the outer function) and the inner function references variable

Dec 19, 2024 · 4 min read · jaylog.hashnode.dev  
Read the article

-   [#closure](https://hashnode.com/tag/closure)
-   [#python](https://hashnode.com/tag/python)
-   [#decorators](https://hashnode.com/tag/decorators)
-   [#scope](https://hashnode.com/tag/scope)
-   [#python-advanced](https://hashnode.com/tag/python-advanced)

## Written by

[Lim Woojae](https://hashnode.com/@jaylog)

@jaylog · Sydney

  
[View profile](https://hashnode.com/@jaylog)

Computer Science @UNSW

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
