question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

__len__ function for samplers?

See original GitHub issue

Is there a reason why samplers define the num_cuts property but don’t implement the __len__ method?

Seems more intuitive to me to access the value of num_cuts through a __len__ method.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
csukuangfjcommented, Mar 2, 2022

Is there a reason why samplers define the num_cuts property

Also, not all samplers return meaningful value for num_cuts. If CutSet is read in lazy mode, for instance, it will return None for the propertynum_cuts

1reaction
danpoveycommented, Mar 2, 2022

I think it’s probably because, in general, samplers may return whole minibatches of cuts, so the two are not equivalent.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Formula, Examples, How to Use LEN Function
The LEN Function is categorized under Excel TEXT functions. The function will return the length of a given text string.
Read more >
Len function (Visual Basic for Applications) | Microsoft Learn
Returns a Long containing the number of characters in a string or the number of bytes required to store a variable. Syntax. Len(string...
Read more >
What Is the LEN Formula in Excel? Definition and Examples
One such function is the LEN function, which returns the length of a cell. By knowing how to properly use the LEN formula...
Read more >
LEN function - Amazon Redshift - AWS Documentation
The LEN function returns an integer indicating the number of characters in the input string. If the input string is a character string,...
Read more >
VBA LEN Function | How to use LEN to find Length of String in ...
THE VBA LEN function returns the “length of the string” and the number of characters in the supplied value. Of all the string...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found