Movatterモバイル変換


[0]ホーム

URL:


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

Commit01bda16

Browse files
PEP8
1 parent2418acf commit01bda16

File tree

4 files changed

+25
-21
lines changed

4 files changed

+25
-21
lines changed

‎bpython/inspection.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
_name=LazyReCompile(r'[a-zA-Z_]\w*$')
4343

44-
ArgSpec=namedtuple('ArgSpec', ['args','varargs','varkwargs','defaults',
44+
ArgSpec=namedtuple('ArgSpec', ['args','varargs','varkwargs','defaults',
4545
'kwonly','kwonly_defaults','annotations'])
4646

4747
FuncProps=namedtuple('FuncProps', ['func','argspec','is_bound_method'])
@@ -229,11 +229,11 @@ def getfuncprops(func, f):
229229
func_name=None
230230

231231
try:
232-
is_bound_method= ((inspect.ismethod(f)andf.__self__isnotNone)
233-
or(func_name=='__init__'andnot
234-
func.endswith('.__init__'))
235-
or(func_name=='__new__'andnot
236-
func.endswith('.__new__')))
232+
is_bound_method= ((inspect.ismethod(f)andf.__self__isnotNone)or
233+
(func_name=='__init__'andnot
234+
func.endswith('.__init__'))or
235+
(func_name=='__new__'andnot
236+
func.endswith('.__new__')))
237237
except:
238238
# if f is a method from a xmlrpclib.Server instance, func_name ==
239239
# '__init__' throws xmlrpclib.Fault (see #202)

‎bpython/line.py‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ def current_object(cursor_offset, line):
9292
s+=m.group(1)
9393
ifnots:
9494
returnNone
95-
returnLinePart(start,start+len(s),s)
95+
returnLinePart(start,start+len(s),s)
9696

9797

9898
current_object_attribute_re=LazyReCompile(r'([\w_][\w0-9_]*)[.]?')
9999

100100

101101
defcurrent_object_attribute(cursor_offset,line):
102102
"""If in attribute completion, the attribute being completed"""
103-
#TODO replace with more general current_expression_attribute
103+
#TODO replace with more general current_expression_attribute
104104
match=current_word(cursor_offset,line)
105105
ifmatchisNone:
106106
returnNone
@@ -216,12 +216,13 @@ def current_dotted_attribute(cursor_offset, line):
216216
returnLinePart(start,end,word)
217217

218218

219-
current_expression_attribute_re=LazyReCompile(r'[.]\s*((?:[\w_][\w0-9_]*)|(?:))')
219+
current_expression_attribute_re=LazyReCompile(
220+
r'[.]\s*((?:[\w_][\w0-9_]*)|(?:))')
220221

221222

222223
defcurrent_expression_attribute(cursor_offset,line):
223224
"""If after a dot, the attribute being completed"""
224-
#TODO replace with more general current_expression_attribute
225+
#TODO replace with more general current_expression_attribute
225226
matches=current_expression_attribute_re.finditer(line)
226227
forminmatches:
227228
if (m.start(1)<=cursor_offsetandm.end(1)>=cursor_offset):

‎bpython/paste.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,9 @@ def paste(self, s):
103103
raisePasteFailed(_('No output from helper program.'))
104104
else:
105105
parsed_url=urlparse(paste_url)
106-
if (notparsed_url.scheme
107-
orany(unicodedata.category(c)=='Cc'
108-
forcinpaste_url)):
106+
if (notparsed_url.schemeor
107+
any(unicodedata.category(c)=='Cc'
108+
forcinpaste_url)):
109109
raisePasteFailed(_('Failed to recognize the helper '
110110
'program\'s output as an URL.'))
111111

‎bpython/repl.py‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -539,14 +539,16 @@ def get_args(self):
539539
class_f=None
540540

541541
if (hasattr(f,'__init__')and
542-
f.__init__isnotobject.__init__):
543-
class_f=f.__init__
542+
f.__init__isnotobject.__init__):
543+
class_f=f.__init__
544544
if ((notclass_for
545-
notinspection.getfuncprops(func,class_f))and
546-
hasattr(f,'__new__')and
547-
f.__new__isnotobject.__new__and
548-
f.__new__.__class__isnotobject.__new__.__class__):# py3
549-
class_f=f.__new__
545+
notinspection.getfuncprops(func,class_f))and
546+
hasattr(f,'__new__')and
547+
f.__new__isnotobject.__new__and
548+
# py3
549+
f.__new__.__class__isnotobject.__new__.__class__):
550+
551+
class_f=f.__new__
550552

551553
ifclass_f:
552554
f=class_f
@@ -683,7 +685,8 @@ def next_indentation(self):
683685
indentation=next_indentation(self.buffer[-1],
684686
self.config.tab_length)
685687
ifindentationandself.config.dedent_after>0:
686-
line_is_empty=lambdaline:notline.strip()
688+
defline_is_empty(line):
689+
returnnotline.strip()
687690
empty_lines=takewhile(line_is_empty,reversed(self.buffer))
688691
ifsum(1for_inempty_lines)>=self.config.dedent_after:
689692
indentation-=1

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp