How To Create Decorator Functions In Python

Поділитися
Вставка
  • Опубліковано 2 чер 2024
  • In this video, I go over how to create and use decorator functions in the Python Programming Language. Decorators allows us to add additional functionality to a function without changing the original function's source code.

КОМЕНТАРІ • 9

  • @chiasmsandmorealpersohn5258
    @chiasmsandmorealpersohn5258 28 днів тому

    As always, well stated and well paced. Thank you!

  • @maloukemallouke9735
    @maloukemallouke9735 23 дні тому +1

    thank you for share
    but where is the result of 1+7?

  • @PidginPlays-yb2vp
    @PidginPlays-yb2vp 22 дні тому

    Good video. You have one mistake in your code. At 3:20 you should have used "return orig_func(x,y)".

  • @em_the_bee
    @em_the_bee 27 днів тому

    3:18 lul, it's 2024, and Python STILL can't into string interpolation that doesn't make you throw up?

    • @lilsos6892
      @lilsos6892 27 днів тому

      idk, print(f"") works flawlessly, idk why he went for that useless shit

    • @em_the_bee
      @em_the_bee 26 днів тому

      @@lilsos6892 meanwhile Ruby 20 years ago and to this day:
      puts "String with #{any_expression}" # notice the lack of random magic numbers and letters

    • @MrNolimitech
      @MrNolimitech 22 дні тому

      There is a lot of ways.
      print("{0}, {1}".format(x, y))
      print("{x}, {y}".format(x=x, y=y))
      print("%s, %s" % (x, y))
      print(f"{x}, {y}") => best and most readable!
      print(x + " " + y) => (might need to put it in str(x), str(y))

    • @TaylorsSoftwareSolutions
      @TaylorsSoftwareSolutions  22 дні тому

      There are many different ways that Python allows you to concatenate strings and printing. The beauty of Python is that it has variety.