Python Forum
declaring object parameters with type
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
declaring object parameters with type
#3
(Dec-13-2022, 07:45 PM)deanhystad Wrote: You can use type annotations
def other_function(brw: Browser):
    x = brw <auto complete now knows to look at Browser>
This will also help when when calling other_function
other_function(<auto complete will tell you a Browsere object is expected

Awesome. Thank you
Reply


Messages In This Thread
declaring object parameters with type - by JonWayn - Dec-13-2022, 07:28 PM
RE: declaring object parameters with type - by JonWayn - Dec-13-2022, 07:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Star Type Error: 'in' object is not callable nman52 3 3,633 May-01-2021, 11:03 PM
Last Post: nman52
  Please explain uncommon way of declaring and using variable [function.variable] esphi 4 2,545 Nov-07-2020, 08:59 AM
Last Post: buran
  Python Class and Object Parameters JoeDainton123 5 3,081 Sep-02-2020, 10:43 AM
Last Post: JoeDainton123
  TypeError: 'type' object is not subscriptable Stef 1 4,741 Aug-28-2020, 03:01 PM
Last Post: Gribouillis
  isinstance() always return true for object type check Yoki91 2 2,759 Jul-22-2020, 06:52 PM
Last Post: Yoki91
  AttributeError: type object 'FunctionNode' has no attribute '_TestValidateFuncLabel__ binhduonggttn 0 2,347 Feb-19-2020, 11:29 AM
Last Post: binhduonggttn
  Type hinting - return type based on parameter micseydel 2 2,628 Jan-14-2020, 01:20 AM
Last Post: micseydel
  Object of type set is not JSON serializable enigma619 5 12,784 Dec-19-2019, 03:30 PM
Last Post: enigma619
  type of object as a string Skaperen 1 2,410 Dec-02-2019, 08:01 AM
Last Post: midarq
  Declaring a Global Variable in a Function Bob1948 4 3,232 Sep-14-2019, 11:16 PM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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