@@ -201,7 +201,7 @@ class Ethernet(GenericStruct):
201201 ether_type = UBInt16 ()
202202 data = BinaryData ()
203203
204- def __init__ (self , destination = None , source = None , vlan = VLAN () ,
204+ def __init__ (self , destination = None , source = None , vlan = None ,
205205 ether_type = None , data = b'' ):
206206 """Create an instance and set its attributes.
207207
@@ -218,7 +218,7 @@ def __init__(self, destination=None, source=None, vlan=VLAN(),
218218 super ().__init__ ()
219219 self .destination = destination
220220 self .source = source
221- self .vlan = vlan
221+ self .vlan = VLAN () if vlan is None else vlan
222222 self .ether_type = ether_type
223223 self .data = data
224224
@@ -271,7 +271,7 @@ class GenericTLV(GenericStruct):
271271 type and value.
272272 """
273273
274- def __init__ (self , tlv_type = 127 , value = BinaryData () ):
274+ def __init__ (self , tlv_type = 127 , value = None ):
275275 """Create an instance and set its attributes.
276276
277277 Args:
@@ -281,7 +281,7 @@ def __init__(self, tlv_type=127, value=BinaryData()):
281281 """
282282 super ().__init__ ()
283283 self .tlv_type = tlv_type
284- self ._value = value
284+ self ._value = BinaryData () if value is None else value
285285
286286 @property
287287 def value (self ):
@@ -547,7 +547,7 @@ class TLVWithSubType(GenericTLV):
547547 :attr:`sub_type` field and a new :attr:`sub_value` field.
548548 """
549549
550- def __init__ (self , tlv_type = 1 , sub_type = 7 , sub_value = BinaryData () ):
550+ def __init__ (self , tlv_type = 1 , sub_type = 7 , sub_value = None ):
551551 """Create an instance and set its attributes.
552552
553553 Args:
@@ -558,7 +558,7 @@ def __init__(self, tlv_type=1, sub_type=7, sub_value=BinaryData()):
558558 """
559559 super ().__init__ (tlv_type )
560560 self .sub_type = sub_type
561- self .sub_value = sub_value
561+ self .sub_value = BinaryData () if sub_value is None else sub_value
562562
563563 @property
564564 def value (self ):
0 commit comments