Skip to content

Commit 88f2c67

Browse files
author
czheo
committed
add simple placeholder
1 parent a5e1e24 commit 88f2c67

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

syntax_sugar/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
from .pipe import *
44
from .infix import *
55
from .stream import *
6+
from .placeholder import *

syntax_sugar/placeholder.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
__all__ = [
2+
'placeholder',
3+
'_',
4+
]
5+
6+
class PlaceHolder:
7+
def __getattribute__(self, action):
8+
def wrapper(*argv, **kwargv):
9+
return lambda data: getattr(data, action)(*argv, **kwargv)
10+
return wrapper
11+
12+
_ = placeholder = PlaceHolder()

0 commit comments

Comments
 (0)