Skip to content

AttributeError #142406

@rabeh2398

Description

@rabeh2398

Bug report

Bug description:

class a:
     def count(self):
        if hasattr(self.count, 'c'):
            self.count.c +=1
        return self.count
    count.c = 0
b=a()
b.count()

CPython versions tested on:

3.12

Operating systems tested on:

Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions