Python Forum
how to make class and instance method (multiple decorator) ?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to make class and instance method (multiple decorator) ?
#2
That doesn't really make sense. You can't call it as a class method, since you won't know the instance. Calling it as an instance method, you can get cls with type(self). So why both?

Also, in Python we almost never use class methods. Why not just a regular function?
Reply


Messages In This Thread
RE: how to make class and instance method (multiple decorator) ? - by micseydel - May-28-2017, 01:37 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  class definition and problem with a method HerrAyas 2 298 Apr-01-2024, 03:34 PM
Last Post: HerrAyas
  super() and order of running method in class inheritance akbarza 7 827 Feb-04-2024, 09:35 AM
Last Post: Gribouillis
  the order of running code in a decorator function akbarza 2 563 Nov-10-2023, 08:09 AM
Last Post: akbarza
  Can I use logging in a class (without multiple messages) mevan 2 624 Oct-16-2023, 11:08 PM
Last Post: mevan
  Curious about decorator syntax rjdegraff42 14 2,205 May-03-2023, 01:21 PM
Last Post: rjdegraff42
  Using one child class method in another child class garynewport 5 1,670 Jan-11-2023, 06:07 PM
Last Post: garynewport
  [Solved] Novice question to OOP: can a method of class A access attributes of class B BigMan 1 1,349 Mar-14-2022, 11:21 PM
Last Post: deanhystad
  class, attribute and method Frankduc 9 2,532 Feb-27-2022, 09:07 PM
Last Post: deanhystad
  Subclass initialized property used in parent class method. Is it bad coding practice? saavedra29 5 1,859 Feb-07-2022, 07:29 PM
Last Post: saavedra29
  Access instance of a class Pavel_47 5 2,135 Nov-19-2021, 10:05 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020