#25370 closed defect (fixed)

prime_to_m_part function : Wrong docstring examples

Reported by: vklein Owned by: vklein
Priority: trivial Milestone: sage-8.3
Component: basic arithmetic Keywords: thursdaysbdx
Cc: Merged in:
Authors: Vincent Klein Reviewers: Vincent Delecroix
Report Upstream: N/A Work issues:
Branch: c9087fc (Commits) Commit: c9087fca0f6c1a26ad9965ffe4446da009ce36fd
Dependencies: Stopgaps:

Description (last modified by vklein)

In function prime_to_m_part(m,n) from misc.py the examples in docstrings don't call the function but call an instance method instead.

sage: 240.prime_to_m_part(2)
15

should be

sage: prime_to_m_part(240,2)
15

Change History (14)

comment:1 Changed 19 months ago by vklein

  • Owner changed from (none) to vklein

comment:2 Changed 19 months ago by vklein

  • Description modified (diff)

comment:3 Changed 19 months ago by vklein

  • Branch set to u/vklein/prime_to_m_part_function___wrong_docstring_examples

comment:4 Changed 19 months ago by vklein

  • Authors set to Vincent Klein
  • Commit set to f29a93d8e51e916c92dc4cd9f4f6c320a42dd6c7
  • Status changed from new to needs_review

New commits:

f29a93dTrac #25370: Fix docstring example in prime_to_m_part ...

comment:5 Changed 19 months ago by vdelecroix

  • Reviewers set to Vincent Delecroix

I think that it is also nice to advertise that there is a method. For example you could add after the other examples

Note also that integers also have a method with the same name::

    sage: 240.prime_to_m_part(2)
    15

The aim of the documentation is multiple: doctest + user documentation.

comment:6 Changed 19 months ago by git

  • Commit changed from f29a93d8e51e916c92dc4cd9f4f6c320a42dd6c7 to c1ecfac769b722c00f47b703f6fc9e9e2e475713

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

c1ecfacTrac #25370: Fix docstring example in prime_to_m_part ...

comment:7 Changed 19 months ago by vklein

Done

comment:8 Changed 19 months ago by vdelecroix

Too many also in "Note also that integers also have a method with the same name"

comment:9 Changed 19 months ago by vdelecroix

  • Status changed from needs_review to needs_work

comment:10 Changed 19 months ago by vklein

  • Keywords thursdaysbdx added

comment:11 Changed 19 months ago by git

  • Commit changed from c1ecfac769b722c00f47b703f6fc9e9e2e475713 to c9087fca0f6c1a26ad9965ffe4446da009ce36fd

Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:

c9087fcTrac #25370: Fix docstring example in prime_to_m_part ...

comment:12 Changed 19 months ago by vklein

  • Status changed from needs_work to needs_review

comment:13 Changed 19 months ago by vdelecroix

  • Status changed from needs_review to positive_review

comment:14 Changed 19 months ago by vbraun

  • Branch changed from u/vklein/prime_to_m_part_function___wrong_docstring_examples to c9087fca0f6c1a26ad9965ffe4446da009ce36fd
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.