Opened 6 years ago

Closed 6 years ago

#29382 closed Uncategorized (duplicate)

don't call objects with __call__ instantly

Reported by: alex Owned by: nobody
Component: Template system Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by alex)

Some objects are callable but have sub-attributes.
In my case the wtforms Label object.
I cannot access Label.text because Label is callable and the resulting str object has not the attribute text.
Please evaluate first the object fully and then check if object is callable. Elsewise the behaviour is inconsistent and confusing.

Sorry for the changes

Change History (5)

comment:1 by alex, 6 years ago

Description: modified (diff)

comment:2 by alex, 6 years ago

Description: modified (diff)

comment:3 by alex, 6 years ago

Description: modified (diff)

comment:4 by Tim Graham, 6 years ago

Is it related to or a duplicate of #29306 and/or #15791. It's not clear to me exactly how your proposal would work and if it would be backwards compatible.

comment:5 by Carlton Gibson, 6 years ago

Resolution: duplicate
Status: newclosed

Closing as duplicate of #29306 and/or #15791.

(wtforms should be able to allow marking labels with do_not_call_in_templates to control the behaviour here.)

Note: See TracTickets for help on using tickets.
Back to Top