mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-10 09:48:32 +00:00
Hacks and fixes to get python code back in reasonable state
This commit is contained in:
@@ -87,10 +87,6 @@ class entity_instance_mixin:
|
||||
print(wall.__class__) # <class 'ifcopenshell.entity_instance'>
|
||||
"""
|
||||
|
||||
@property
|
||||
def file(self):
|
||||
raise NotImplementedError
|
||||
|
||||
def __getattr__(self, name: str) -> Any:
|
||||
if name in ("this", "thisown") or name.startswith("_swig_"):
|
||||
return object.__getattr__(self, name)
|
||||
@@ -300,15 +296,6 @@ class entity_instance_mixin:
|
||||
__rge__ = functools.partialmethod(compare, op=operator.ge, reverse=True)
|
||||
__rgt__ = functools.partialmethod(compare, op=operator.gt, reverse=True)
|
||||
|
||||
def __hash__(self):
|
||||
# Proper entity instances have a stable identity by means of the numeric
|
||||
# step id. Selected type instances (such as IfcPropertySingleValue.NominalValue
|
||||
# always have id=0, so we hash <type, value, file pointer>
|
||||
if id_ := self.id():
|
||||
return hash((id_, self.file_pointer()))
|
||||
else:
|
||||
return hash((self.is_a(), self[0], self.file_pointer()))
|
||||
|
||||
def __dir__(self):
|
||||
return sorted(
|
||||
set(
|
||||
|
||||
Reference in New Issue
Block a user