Python angle brackets

I want to create packages using scapy. While looking at the members of the IP () class, I came across the following code idiom:

'fieldtype': {

    'frag': <Field (IP,IPerror).frag>, 
    'src': <Field (IP,IPerror).src>, 
    'proto': <Field (IP,IPerror).proto>, 
    'tos': <Field (IP,IPerror).tos>, 
    'dst': <Field (IP,IPerror).dst>, 
    'chksum': <Field (IP,IPerror).chksum>, 
    'len': <Field (IP,IPerror).len>, 
    'options': <Field (IP,IPerror).options>, 
    'version': <Field (IP,IPerror).version>, 
    'flags': <Field (IP,IPerror).flags>, 
    'ihl': <Field (IP,IPerror).ihl>, 
    'ttl': <Field (IP,IPerror).ttl>, 
    'id': <Field (IP,IPerror).id>}, 
    'time': 1465637588.477862, 
    'initialized': 1, 
    'overloaded_fields': {},

I am relatively new to Python. Can someone explain to me what purpose the angle brackets serve in each field type definition?

I tried to figure it out myself using the following documentation, but was completely stuck.

Scapy 2.3.1

thanks

+3
source share
1 answer

reprWhen applied to an instance Field, the following definition for is used __repr__, which is the source of non-Python syntax.

def __repr__(self):
    return "<Field (%s).%s>" % (",".join(x.__name__ for x in self.owners),self.name)
+1
source

Source: https://habr.com/ru/post/1016173/


All Articles