Python Forum
What do you call this type of parameter?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What do you call this type of parameter?
#1
In some code I've seen stuff like this:

def some_function(a -> int):
    #do something
I thought a -> int was called a decorator, but a decorator seems to be this:

def some_function(func):
    def some_func(*args):
        #do something to func
        return func(*args)
    return some_func

@some_function
def some_other_function(params):
    #do something
So if a -> int is not a decorator, what's it called and what does it do?
Reply


Messages In This Thread
What do you call this type of parameter? - by league55 - Feb-16-2018, 10:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  determine parameter type in definition function akbarza 1 605 Aug-24-2023, 01:46 PM
Last Post: deanhystad
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 11,163 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  python call stored procedure with two parameter mg24 4 1,565 Sep-27-2022, 05:02 AM
Last Post: deanhystad
  Why can't I explicitly call __bool__() on sequence type? quazirfan 11 4,702 Aug-20-2021, 06:49 AM
Last Post: Gribouillis
  Type hinting - return type based on parameter micseydel 2 2,519 Jan-14-2020, 01:20 AM
Last Post: micseydel
  what would you call the input for the parameter(s) of a function you have defined? rix 3 2,467 Dec-16-2019, 12:04 AM
Last Post: rix

Forum Jump:

User Panel Messages

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