Conversation
|
I like that and wanted to do this for a long time, was scared of the breaking change though. could we instead define a callable and then in the property |
|
I guess that would work, quite a bit of boilerplate for that simple change, but everyone loves downward compatibility! |
lkstrp
left a comment
There was a problem hiding this comment.
We might also want to add __repr__ to the descriptor. Otherwise the memory reference is shown, which is confusing.
Even cleaner, which would not mock a simple boolean, the process would probably be to have a module wide option setting, raise a deprecation warning for .empty() without breaking behaviour, and allow opting in to use .empty.
d8ef651 to
df4cbfd
Compare
|
Added the |
In view of #424 (ie. empty being mostly True automatically), i would argue the current use of
emptyis quite limited and i'd prefer to take this chance to make it apropertyas it is in pandas, since it is today too easy to misuse asexpr.emptywhich is always truthy.Contrarily the upgrade path fromexpr.empty()toexpr.emptywill always raise a clear Exception.Update: Added the wrapper that @FabianHofmann sketched below to smooth the transition.
Checklist
doc.doc/release_notes.rstof the upcoming release is included.