Python *args : Design Patterns In Python

Опубликовано: 09 Январь 2025
на канале: SBCODE
238
2

Documentation : https://sbcode.net/python/bridge/#the...

The *args argument takes all arguments that were sent to this method, and packs them into a Tuple.

It is useful when you don't know how many arguments, or what types, will be sent to a method, and you want the method to support any number of arguments or types being sent to it.

Read the `*args` command as 'pack all the supplied arguments into a tuple named `args`

(Book) Sometimes you just want to switch off your computer and read from a book. So, all GoF patterns are discussed in my Design Patterns In Python book
https://www.amazon.com/dp/B08XLJ8Z2J : ASIN B08XLJ8Z2J
https://www.amazon.com/dp/B08Z282SBC : ASIN B08Z282SBC

#pythonArgs
#designPatterns
#pythonDesignPatterns