scapy - Angle brackets in Python -


this question has answer here:

i want craft packets using scapy. when looking through ip() class members came across 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 relatively new python. can explain me purpose angle brackets serve in each field type definition?

i have been trying figure out myself using following documentation got stuck.

scapy 2.3.1

thanks

repr when applied field instance uses following definition __repr__ source of not python syntax.

def __repr__(self):     return "<field (%s).%s>" % (",".join(x.__name__ x in self.owners),self.name) 

Comments

Popular posts from this blog

wordpress - (T_ENDFOREACH) php error -

Export Excel workseet into txt file using vba - (text and numbers with formulas) -

Using django-mptt to get only the categories that have items -