Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/anirudhg07/python-decorator


https://github.com/anirudhg07/python-decorator

Last synced: 9 days ago
JSON representation

Awesome Lists containing this project

README

        

# The '@' decorator in python

In python we have various symbols and operators. Out of these, there is a veyr famous symbol '@', which has a variety of usage in python code.

In the files above we I have put various examples on how to use the '@' decorator.


Uses of `@`:
1) As an operator of Matrix multiplication
2) In object-oriented programming, making usage of instanced and methods very convenient
3) To create wrapper function,used to give properties to another function. Refer '@'_basics for this.


In Object Oriented Programming, we mainly see the usage of `@property`. Refer property@ for more detail.

# args and kwargs
You must have seen the usage of *args and **kwargs in little advanced python coding, for example while coding AI models,etc. In the above file rleated to args and kwargs we see what these are and how they play a very convenient role
in python coding.