Replies

  • Nowadays, Python is trending and widely opted by in development as well as software testing solutions due to its vast libraries and productivity. One of the design pattern supported by Python is decorator.
    Any callable object created to modify a class or a function in Python is called as decorator. The  decorator utilizes the reference to function “func” or class “C” which adds functionalities to existing class or function.

    There are two decorators in Python:
    - function decorator

    - class decorator

    Basic Decorator Syntax and Example:

    def myDecorator(func):

                def addFunc():
    #new statements

    print(“This is addition to actual function”)
    #function calling

    func()

    return addFunc

    @myDecorator
    def realFunction():
    print(“this is actual function”)
    realFunction()

    The @ here defines that the function below this statement will be decorated with myDecorator.

    The Best Software Testing Services Company - QASource
    Partner with the leading software testing company - QASource, and accomplish all your software testing services goals within strict deadlines and bud…
This reply was deleted.
    results->result as $result) { ?>
  1. jobtitle;?>
    company;?>(formattedRelativeTime;?>)city;?>, state;?>
    Welcome to Mobile QA Zone, a Next Generation Software Testing Community.Invite your friends to join this community.Write to us to become a featured member.