You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@avro.apache.org by "Michael A. Smith (Jira)" <ji...@apache.org> on 2023/07/16 14:59:00 UTC

[jira] [Resolved] (AVRO-3796) Use decorator and methods to express properties

     [ https://issues.apache.org/jira/browse/AVRO-3796?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michael A. Smith resolved AVRO-3796.
------------------------------------
    Fix Version/s: 1.11.3
       Resolution: Fixed

Trivial, stylistic change to improve future maintainability.

> Use decorator and methods to express properties
> -----------------------------------------------
>
>                 Key: AVRO-3796
>                 URL: https://issues.apache.org/jira/browse/AVRO-3796
>             Project: Apache Avro
>          Issue Type: Task
>          Components: python
>    Affects Versions: 1.11.2
>            Reporter: Michael A. Smith
>            Assignee: Michael A. Smith
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 1.11.3
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> One of the issues preventing progress on AVRO-2921 is that it's difficult to add type hints to properties when they're expressed like this:
> {code:java}
> class Thing:
>     x = property(lambda self: self._x){code}
> as they often are in the python source code. So I would like to refactor all the cases where this occurs to the decorator style, like this
> {code:java}
> class Thing:
>     @property
>     def x(self):
>         return self._x{code}
> This will make it easier to add type hints to these methods later on.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)