Skip to content

Commit b590bbf

Browse files
Remove properties that are modules or classes
1 parent 2cbf217 commit b590bbf

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

record_api/apis.py

+10
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ class Config:
7272

7373
def __ior__(self, other: API) -> API:
7474
update_ior(self.modules, other.modules)
75+
# Remove any properties which are other just other modules
76+
for module_name, module in self.modules.items():
77+
for property_ in list(module.properties.keys()):
78+
if f"{module_name}.{property_}" in self.modules:
79+
del module.properties[property_]
7580
return self
7681

7782
def json(self, **kwargs) -> str:
@@ -140,6 +145,11 @@ def __ior__(self, other: Module) -> Module:
140145

141146
# classes
142147
update_ior(self.classes, other.classes)
148+
# property -> classes
149+
merge_intersection(
150+
self.classes, self.properties, lambda class_, property: class_
151+
)
152+
143153
# function -> class constructor
144154
merge_intersection(self.classes, self.functions, merge_method_class)
145155
merge_intersection(

0 commit comments

Comments
 (0)