Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix turtle deprecations #89995

Closed
hugovk opened this issue Nov 18, 2021 · 5 comments
Closed

Fix turtle deprecations #89995

hugovk opened this issue Nov 18, 2021 · 5 comments
Labels
3.11 only security fixes stdlib Python modules in the Lib dir

Comments

@hugovk
Copy link
Member

hugovk commented Nov 18, 2021

BPO 45837
Nosy @ambv, @hugovk
PRs
  • bpo-45837: Properly deprecate turtle.RawTurtle.settiltangle #29618
  • [3.10] bpo-45837: Note tiltangle is not deprecated, it's really settiltangle #29629
  • [3.9] bpo-45837: Note tiltangle is not deprecated, it's really settiltangle #29630
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2021-11-19.18:56:10.773>
    created_at = <Date 2021-11-18.13:43:45.477>
    labels = ['library', '3.11']
    title = 'Fix turtle deprecations'
    updated_at = <Date 2021-11-19.18:56:10.772>
    user = 'https://github.com/hugovk'

    bugs.python.org fields:

    activity = <Date 2021-11-19.18:56:10.772>
    actor = 'lukasz.langa'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-11-19.18:56:10.773>
    closer = 'lukasz.langa'
    components = ['Library (Lib)']
    creation = <Date 2021-11-18.13:43:45.477>
    creator = 'hugovk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 45837
    keywords = ['patch']
    message_count = 5.0
    messages = ['406536', '406538', '406614', '406615', '406616']
    nosy_count = 2.0
    nosy_names = ['lukasz.langa', 'hugovk']
    pr_nums = ['29618', '29629', '29630']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue45837'
    versions = ['Python 3.11']

    @hugovk
    Copy link
    Member Author

    hugovk commented Nov 18, 2021

    turtle's settiltangle was deprecated in Python 3.1:

    "Deprecated since version 3.1."

    https://docs.python.org/3.10/library/turtle.html#turtle.settiltangle says of settiltangle:

    And the reason:

    "Turtle.tiltangle() has been enhanced in functionality: it now can be used to get or set the tiltangle. Turtle.settiltangle() has been deprecated."

    https://docs.python.org/3.10/library/turtle.html#changes-since-python-3-0

    However, in docstrings, tiltangle was accidentally marked as deprecated:

    "Deprecated since Python 3.1"

    https://github.com/python/cpython/blob/v3.10.0/Lib/turtle.py#L2880

    Neither tiltangle nor settiltangle raise DeprecationWarnings.

    So let's:

    • Correct tiltangle's docstring to say it's not really deprecated
    • Update settiltangle's docstring to say it is deprecated
    • Add a DeprecationWarning to settiltangle
    • Internally call self.tiltangle instead of self.settiltangle

    BPO references:

    2009 https://bugs.python.org/issue5923 - settiltangle originally deprecated, with rationale.

    2010 https://bugs.python.org/issue7888 - the mixup was discovered and apparently corrected in py3k and release31-maint. I've not done the SCM archaeology to discover why this regressed.

    2020 https://bugs.python.org/issue41165 - both mentioned as deprecated, mixup not noted.

    @hugovk hugovk added 3.11 only security fixes stdlib Python modules in the Lib dir labels Nov 18, 2021
    @ambv
    Copy link
    Contributor

    ambv commented Nov 18, 2021

    New changeset c94664c by Hugo van Kemenade in branch 'main':
    bpo-45837: Properly deprecate turtle.RawTurtle.settiltangle (GH-29618)
    c94664c

    @ambv
    Copy link
    Contributor

    ambv commented Nov 19, 2021

    New changeset e8d41ee by Hugo van Kemenade in branch '3.9':
    bpo-45837: Note tiltangle is not deprecated, it's really settiltangle (GH-29630)
    e8d41ee

    @ambv
    Copy link
    Contributor

    ambv commented Nov 19, 2021

    New changeset 9501e8d by Hugo van Kemenade in branch '3.10':
    bpo-45837: Note tiltangle is not deprecated, it's really settiltangle (GH-29629)
    9501e8d

    @ambv
    Copy link
    Contributor

    ambv commented Nov 19, 2021

    Thanks, Hugo! ✨ 🍰 ✨

    @ambv ambv closed this as completed Nov 19, 2021
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.11 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants