Skip to content

Commit 558e1c3

Browse files
author
czheo
committed
hasattr -> has
1 parent f6ab7a7 commit 558e1c3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ import requests
108108

109109
### infix function
110110
``` python
111-
from syntax_sugar import is_a, hasattr, to, by, drop
111+
from syntax_sugar import is_a, has, to, by, drop
112112

113113
1 /is_a/ int
114114
# equivalent to `isinstance(1, int)`
115115

116-
range(10) /hasattr/ '__iter__'
116+
range(10) /has/ '__iter__'
117117
# equivalent to `hasattr(range(10), "__iter__")`
118118

119119
1 /to/ 10

syntax_sugar/infix.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
'by',
99
'INF',
1010
'NEGINF',
11-
'hasattr',
11+
'has',
1212
'take',
1313
'drop',
1414
]
@@ -24,7 +24,7 @@ def __rtruediv__(self, left):
2424
return infix(self.func, left)
2525

2626
is_a = infix(isinstance)
27-
hasattr = infix(hasattr)
27+
has = infix(hasattr)
2828

2929
@infix
3030
def to(start, end):

0 commit comments

Comments
 (0)