Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 38a0560

Browse files
Minor cleanup selection_node
1 parent f337a3d commit 38a0560

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

‎library/selection_node.py‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ def node_from_range_new(root,atok,r,special = False,lenient = False):
3333
if lenient:
3434
inside = lambda x,y: (y[0]<=x[0]<=y[1] and y[0]<=x[1]<=y[1] and not y[0]==y[1]==0)
3535
generic_fix(root,atok)
36-
# print(" the fields are now",root._fields)
3736
for child in ast.iter_child_nodes(root):
3837
# print(" just to check something out",child,atok.get_text_range(child))
3938
# print(" and the child fields are ",child._fields)
@@ -80,10 +79,8 @@ def node_from_range_old(root,atok, r ):
8079
inside = lambda x,y: (y[0]<=x[0]<y[1] and y[0]<x[1]<=y[1])
8180
candidates =([(node,atok.get_text_range(node)) for node in ast.walk( root ) if not isinstance(node,ast.Module)
8281
and inside(r,atok.get_text_range(node))])
83-
print("inside note from range \n")
8482
for x in candidates:
8583
print(x,atok.get_text_range(x))
86-
print("outside note from range \n",min( candidates , key= lambda y :(y[1][1]-y[1][0]) )[0])
8784

8885
return min( candidates , key= lambda y :(y[1][1]-y[1][0]) )[0]
8986

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /