Skip to content

Why is there a concept "unbound method" in <Descriptor HowTo Guide> python3 version? #74478

Closed

Description

@debuggy
mannequin
BPO 30292
Superseder
  • bpo-23702: docs.python.org/3/howto/descriptor.html still refers to "unbound methods"
  • 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 2017-05-06.14:20:15.867>
    created_at = <Date 2017-05-06.13:05:43.286>
    labels = ['type-feature', 'docs']
    title = 'Why is there a concept "unbound method" in <Descriptor HowTo Guide> python3 version?'
    updated_at = <Date 2017-05-06.14:20:15.867>
    user = 'https://bugs.python.org/debuggy'

    bugs.python.org fields:

    activity = <Date 2017-05-06.14:20:15.867>
    actor = 'martin.panter'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2017-05-06.14:20:15.867>
    closer = 'martin.panter'
    components = ['Documentation']
    creation = <Date 2017-05-06.13:05:43.286>
    creator = 'debuggy'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 30292
    keywords = []
    message_count = 1.0
    messages = ['293160']
    nosy_count = 2.0
    nosy_names = ['docs@python', 'debuggy']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '23702'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue30292'
    versions = ['Python 3.6']

    Activity

    1. debuggy commented on May 6, 2017

      debuggymannequin
      MannequinAuthor

      When I read <Descriptor HowTo Guide> (python 3.6.1 version), I found there is a concept of 'unbound method' in some places. However, when I referred to <What’s New In Python 3.0>, it said the concept of “unbound methods” has been removed from the language.

      So I wondered if there should be a change in <Descriptor HowTo Guide> python3 version?

      For instance, in this code example of the guide:

      >>> class D(object):
      ...     def f(self, x):
      ...         return x
      ...
      >>> d = D()
      >>> D.__dict__['f']  # Stored internally as a function
      <function f at 0x00C45070>
      >>> D.f              # Get from a class becomes an unbound method
      <unbound method D.f> 
      >>> d.f              # Get from an instance becomes a bound method
      <bound method D.f of <__main__.D object at 0x00B18C90>>

      When I tested myself, the result of statement "D.f" should be <function> not <unbound method>.

    2. added
      docsDocumentation in the Doc dir
      type-featureA feature request or enhancement
      on May 6, 2017
    3. 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

      docsDocumentation in the Doc dirtype-featureA feature request or enhancement

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions