Skip to content

Same name for an attribute and a function #1926

Closed
@mrcloma

Description

@mrcloma

Hi, I'm new to programming and I'm not sure if it's a problem, but the code(
Python/data_structures/queue/queue_on_list.py) have the same name for an attribute and a function.

class Queue:
    def __init__(self):
        self.entries = []
        self.length = 0
        self.front = 0

    def front(self):
        return self.entries[0]

When executed it gives me the error:
TypeError: 'int' object is not callable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions