Skip to content

docstrings for issubset and in should have related-but-not-synonymous signatures split out #22639

@Sacha0

Description

@Sacha0

The existing docstring for issubset

  issubset(a, b)
  (a,b) -> Bool
  (a,b) -> Bool
  (a,b) -> Bool

  Determine whether every element of a is also in b, using in.

lists the related-but-not-synonymous operations and in the manner synonyms are usually listed. Perhaps the relevant lines should be removed from the issubset docstring, and those operations should receive their own docstrings. Cross references between those docstrings would be fantastic as well.

The docstring for in suffers from the same issue:

  in(item, collection) -> Bool
  (item,collection) -> Bool
  (collection,item) -> Bool
  (item,collection) -> Bool
  (collection,item) -> Bool

  Determine whether an item is in the given collection, in the sense that it is == to one of
  the values generated by iterating over the collection. Some collections need a slightly
  different definition; for example Sets check whether the item isequal to one of the
  elements. Dicts look for (key,value) pairs, and the key is compared using isequal. To test
  for the presence of a key in a dictionary, use haskey or k in keys(dict).

  julia> a = 1:3:20
  1:3:19

  julia> 4 in a
  true

  julia> 5 in a
  false

Best!

Metadata

Metadata

Assignees

No one assigned

    Labels

    HacktoberfestGood for Hacktoberfest participantsdocsThis change adds or pertains to documentationgood first issueIndicates a good issue for first-time contributors to Julianeeds docsDocumentation for this change is required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions