Skip to content

Fix turtle deprecations #89995

Closed
Closed

Description

@hugovk
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']

    Activity

    1. hugovk commented on Nov 18, 2021

      @hugovk
      MemberAuthor

      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.

    2. added
      3.11only security fixes
      stdlibStandard Library Python modules in the Lib/ directory
      on Nov 18, 2021
    3. ambv commented on Nov 18, 2021

      @ambv
      Contributor

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

    4. ambv commented on Nov 19, 2021

      @ambv
      Contributor

      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

    5. ambv commented on Nov 19, 2021

      @ambv
      Contributor

      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

    6. ambv commented on Nov 19, 2021

      @ambv
      Contributor

      Thanks, Hugo! ✨ 🍰 ✨

    7. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    No one assigned

      Labels

      3.11only security fixesstdlibStandard Library Python modules in the Lib/ directory

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions