@@ -281,17 +281,6 @@ def _FishScript(name, commands, default_options=None):
281281 )
282282
283283
284- def GetClassAttrsDict (component ):
285- """Gets the attributes of the component class, as a dict with name keys."""
286- if not inspect .isclass (component ):
287- return None
288- class_attrs_list = inspect .classify_class_attrs (component )
289- return {
290- class_attr .name : class_attr
291- for class_attr in class_attrs_list
292- }
293-
294-
295284def MemberVisible (component , name , member , class_attrs = None , verbose = False ):
296285 """Returns whether a member should be included in auto-completion or help.
297286
@@ -328,7 +317,7 @@ def MemberVisible(component, name, member, class_attrs=None, verbose=False):
328317 if inspect .isclass (component ):
329318 # If class_attrs has not been provided, compute it.
330319 if class_attrs is None :
331- class_attrs = GetClassAttrsDict (class_attrs )
320+ class_attrs = inspectutils . GetClassAttrsDict (class_attrs )
332321 class_attr = class_attrs .get (name )
333322 if class_attr and class_attr .kind in ('method' , 'property' ):
334323 # methods and properties should be accessed on instantiated objects,
@@ -355,9 +344,9 @@ def VisibleMembers(component, class_attrs=None, verbose=False):
355344 Args:
356345 component: The component whose members to list.
357346 class_attrs: (optional) If component is a class, you may provide this as:
358- GetClassAttrsDict(component). If not provided, it will be computed.
359- If provided, this determines how class members will be treated for
360- visibility. In particular, methods are generally hidden for
347+ inspectutils. GetClassAttrsDict(component). If not provided, it will be
348+ computed. If provided, this determines how class members will be treated
349+ for visibility. In particular, methods are generally hidden for
361350 non-instantiated classes, but if you wish them to be shown (e.g. for
362351 completion scripts) then pass in a different class_attr for them.
363352 verbose: Whether to include private members.
@@ -371,7 +360,7 @@ def VisibleMembers(component, class_attrs=None, verbose=False):
371360
372361 # If class_attrs has not been provided, compute it.
373362 if class_attrs is None :
374- class_attrs = GetClassAttrsDict (component )
363+ class_attrs = inspectutils . GetClassAttrsDict (component )
375364 return [
376365 (member_name , member ) for member_name , member in members
377366 if MemberVisible (component , member_name , member , class_attrs = class_attrs ,
0 commit comments