what is payload

eth0 ethernet.+NOSPAM+zero at gmail.com
Thu Sep 7 03:57:54 EDT 2017


Era el Thu, 7 Sep 2017 00:48:34 -0700 (PDT) en comp.lang.python,
cuando de repente Andrej Viktorovich
dijo lo siguiente acerca de
what is payload:

>  Hello,
> 
>  Have working sample with strange property - payload:
> 
>  class ExampleClass(object):
>      def __init__(self,value):
>          print("Initialising instance...")
>          self.payload = value
> 
>  exampleInstance = ExampleClass(42)
>  print(exampleInstance.payload)
> 
> 
>  Is it some default field that all objects has? What it is used for?
> 
>   

No, it's just that Python lets you add members to your instance at
runtime. In this case, that code is adding an instance variable called
payload, but it's not some special property or anything.



More information about the Python-list mailing list