Skip to content

Warning of utils.deprecated for properties is ugly #8113

@jnothman

Description

@jnothman

The contributor's guide recommends using the deprecated decorator for attributes as follows:

    @property
    @deprecated("Attribute labels_ was deprecated in version 0.13 and "
                "will be removed in 0.15. Use 'classes_' instead")
    def labels_(self):
        return self.classes_

However the warning produced begins "Function labels_ is deprecated; Attribute labels_ was deprecated ...". This is ugly. It should just say "Attribute labels_ is deprecated; ...".

We should either:

  • remove the boilerplate "Function x is deprecated" as I think we're not counting on it being there in our deprecation messages elsewhere
  • handle explicitly the case where deprecated decorates a property

(No doubt futurepast aspires to do all of this right.)

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