Python Forum
a function common to methods of a class
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
a function common to methods of a class
#2
def common_func(text):
    print(text)


class AClass:
    def multiple_method1(salf):
        common_func("multiple_method1")

    def multiple_method2(salf):
        common_func("multiple_method2")
Skaperen likes this post
Reply


Messages In This Thread
RE: a function common to methods of a class - by Yoriz - Oct-03-2021, 05:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  The function of double underscore back and front in a class function name? Pedroski55 9 762 Feb-19-2024, 03:51 PM
Last Post: deanhystad
  Class test : good way to split methods into several files paul18fr 4 525 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  Structuring a large class: privite vs public methods 6hearts 3 1,115 May-05-2023, 10:06 AM
Last Post: Gribouillis
  TimeOut a function in a class ? Armandito 1 1,682 Apr-25-2022, 04:51 PM
Last Post: Gribouillis
  Calling a class from a function jc4d 5 1,867 Dec-17-2021, 09:04 PM
Last Post: ndc85430
  access share attributed among several class methods drSlump 0 1,082 Nov-18-2021, 03:02 PM
Last Post: drSlump
  Tuple generator, and function/class syntax quazirfan 3 3,948 Aug-10-2021, 09:32 AM
Last Post: buran
  Listing All Methods Of Associated With A Class JoeDainton123 3 2,387 May-10-2021, 01:46 AM
Last Post: deanhystad
  too many methods in class - redesign idea? Phaze90 3 2,526 Mar-05-2021, 09:01 PM
Last Post: deanhystad
  Special Methods in Class Nikhil 3 2,331 Mar-04-2021, 06:25 PM
Last Post: Nikhil

Forum Jump:

User Panel Messages

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