You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While discussing the intersect operator with @jasondellaluce, we realized there's no easy way to check for an empty list or, more generally, to know a list length.
It would be beneficial when one needs to create an exception, for example: len(class.somelist) > 0 and not class.somelist intersect (allowlist)
(n.b. not class.somelist intersect (allowlist) is true when class.somelist is an empty list)
Furthermore, there may be compelling use cases where knowing the length of a list or a string is useful.
Feature
Develop a len() transformer that accepts a sizable type (e.g., LIST, CHARBUF, BYTEBUF) as input and returns its length as an integer.
Alternatives
No actual alternatives have been considered yet.
Additional context
This is a very rough proposal, which may need some discussion. Feedback is welcome.
The text was updated successfully, but these errors were encountered:
Motivation
While discussing the
intersect
operator with @jasondellaluce, we realized there's no easy way to check for an empty list or, more generally, to know a list length.It would be beneficial when one needs to create an exception, for example:
len(class.somelist) > 0 and not class.somelist intersect (allowlist)
(n.b.
not class.somelist intersect (allowlist)
is true whenclass.somelist
is an empty list)Furthermore, there may be compelling use cases where knowing the length of a list or a string is useful.
Feature
Develop a
len()
transformer that accepts a sizable type (e.g.,LIST
,CHARBUF
,BYTEBUF
) as input and returns its length as an integer.Alternatives
No actual alternatives have been considered yet.
Additional context
This is a very rough proposal, which may need some discussion. Feedback is welcome.
The text was updated successfully, but these errors were encountered: