@property not working with other decorators

Abierto
#658 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
48/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
javascript, python
Área
compilers

Línea de trabajo

Start with the decorator example in Test.py and compare it with the generated Test.js, focusing on how @property is combined with another decorator. Reproduce the callable error from the generated output and trace the compiler's decorator handling. Done means the example transpiles and runs without treating the property object as a callable, while preserving normal property behavior.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

IS: limitation

Test.py

def deco(func):
    def inner(func):
        return func()
    return inner

class ProfilePlotCanvas:

    @deco
    @property
    def _make_plot(self):
        return

Test.js

// Transcrypt'ed from Python, 2019-08-16 10:19:00
import {AssertionError, AttributeError, BaseException, DeprecationWarning, Exception, IndexError, IterableError, KeyError, NotImplementedError, RuntimeWarning, StopIteration, UserWarning, ValueError, Warning, __JsIterator__, __PyIterator__, __Terminal__, __add__, __and__, __call__, __class__, __envir__, __eq__, __floordiv__, __ge__, __get__, __getcm__, __getitem__, __getslice__, __getsm__, __gt__, __i__, __iadd__, __iand__, __idiv__, __ijsmod__, __ilshift__, __imatmul__, __imod__, __imul__, __in__, __init__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __jsUsePyNext__, __jsmod__, __k__, __kwargtrans__, __le__, __lshift__, __lt__, __matmul__, __mergefields__, __mergekwargtrans__, __mod__, __mul__, __ne__, __neg__, __nest__, __or__, __pow__, __pragma__, __proxy__, __pyUseJsNext__, __rshift__, __setitem__, __setproperty__, __setslice__, __sort__, __specialattrib__, __sub__, __super__, __t__, __terminal__, __truediv__, __withblock__, __xor__, abs, all, any, assert, bool, bytearray, bytes, callable, chr, copy, deepcopy, delattr, dict, dir, divmod, enumerate, filter, float, getattr, hasattr, input, int, isinstance, issubclass, len, list, map, max, min, object, ord, pow, print, property, py_TypeError, py_iter, py_metatype, py_next, py_reversed, py_typeof, range, repr, round, set, setattr, sorted, str, sum, tuple, zip} from './org.transcrypt.__runtime__.js';
var __name__ = '__main__';
export var deco = function (func) {
	var inner = function (func) {
		return func ();
	};
	return inner;
};
export var ProfilePlotCanvas =  __class__ ('ProfilePlotCanvas', [object], {
	__module__: __name__,
	get _get__make_plot () {return __get__ (this, deco (property (function (self) {
		return ;
	})));}
});
Object.defineProperty (ProfilePlotCanvas, '_make_plot', property.call (ProfilePlotCanvas, ProfilePlotCanvas._get__make_plot));;

When @property is not the only decorator, it is added to the list of decorators in addition to the usual Object.defineProperty behavior. Since property() returns an object and not a callable, it causes an error.

Lenguaje dominante
Python
Estrellas
2.9k
Forks
218
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de TranscryptOrg/Transcrypt

Todos los issues de TranscryptOrg/Transcrypt

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.