Skip to content

Commit

Permalink
add abstractclassmethod obj
Browse files Browse the repository at this point in the history
  • Loading branch information
yoelcortes committed Jan 24, 2025
1 parent 92e37d4 commit a918848
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
2 changes: 1 addition & 1 deletion thermosteam/preferences.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ sort: false
stream_color: '#4e4e4e'
stream_width: F_mass
tooltips_full_results: false
unit_color: #fcfcfc:#e6e6e6
unit_color: '#fcfcfc:#e6e6e6'
unit_label_color: black
unit_periphery_color: '#4e4e4e'
15 changes: 13 additions & 2 deletions thermosteam/utils/abstract_method.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
# for license details.
"""
"""
__all__ = ('AbstractMethod', 'NotImplementedMethod')
__all__ = ('AbstractMethod', 'NotImplementedMethod',
'AbstractClassMethod', 'NotImplementedClassMethod')

class AbstractMethodType:
__slots__ = ()
Expand All @@ -18,5 +19,15 @@ def __new__(self): return AbstractMethod
def __call__(self): return NotImplemented
def __bool__(self): return False
def __repr__(self): return "AbstractMethod"

class AbstractClassMethodType:

@property
def __name__(self): return "AbstractClassMethod"
def __new__(self): return AbstractClassMethod
def __call__(self): return NotImplemented
def __bool__(self): return False
def __repr__(self): return "AbstractClassMethod"

AbstractMethod = NotImplementedMethod = object.__new__(AbstractMethodType)
AbstractMethod = NotImplementedMethod = object.__new__(AbstractMethodType)
AbstractClassMethod = NotImplementedClassMethod = object.__new__(AbstractClassMethodType)

0 comments on commit a918848

Please sign in to comment.