Skip to content

Commit 4ec059a

Browse files
committed
Don't suggest int attributes for float literals.
This fixes issue 36.
1 parent b44184e commit 4ec059a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

bpython/cli.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ def attr_matches(self, text):
400400
return []
401401

402402
expr, attr = m.group(1, 3)
403+
if expr.isdigit():
404+
# Special case: float literal, using attrs here will result in
405+
# a SyntaxError
406+
return []
403407
obj = eval(expr, self.interp.locals)
404408
with AttrCleaner(obj):
405409
matches = self.attr_lookup(obj, expr, attr)

0 commit comments

Comments
 (0)