Unify behaviour of block[path] and block.get(path)

This commit is contained in:
Sybren A. Stüvel
2018-02-26 18:14:23 +01:00
parent 127f357e49
commit a56e985cdc
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -384,7 +384,7 @@ class BlendFileBlock:
path: dna.FieldPath,
default=...,
null_terminated=True,
as_str=True,
as_str=False,
base_index=0,
) -> typing.Any:
"""Read a property and return the value.
@@ -507,7 +507,7 @@ class BlendFileBlock:
raise exceptions.SegmentationFault('address does not exist', path, result)
def __getitem__(self, path: dna.FieldPath):
return self.get(path, as_str=False)
return self.get(path)
def __setitem__(self, item, value):
self.set(item, value)