Skip to content

get_block() functionality? #6

Answered by StefanoTrv
bdp-utah1 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
I'll consider adding it in the future.
For now, you can use this simple implementation:

def get_block(code):
    ancestors = cm.get_ancestors(code)
    for c in ancestors:
        if cm.is_block(c):
            return c
    return None

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by StefanoTrv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants