Ukkonen-s-Suffix-Tree-Algorithm icon indicating copy to clipboard operation
Ukkonen-s-Suffix-Tree-Algorithm copied to clipboard

Uses Python 2 syntax

Open tripleee opened this issue 7 years ago • 2 comments

I tried to translate to Python 3 but the meaning of the double parentheses in the setoutedge definition eludes me.

def setoutedge(self, key, (anode, label_start_index, label_end_index, bnode)):

I guessed it would mean

def setoutedge(self, key, anode=None, label_start_index=None, label_end_index=None, bnode=None):

but implementing this change just broke the code in new ways. Could you please explain what this definition means?

tripleee avatar Apr 23 '18 12:04 tripleee

I tried to translate to Python 3 but the meaning of the double parentheses in the setoutedge definition eludes me.

def setoutedge(self, key, (anode, label_start_index, label_end_index, bnode)):

I guessed it would mean

def setoutedge(self, key, anode=None, label_start_index=None, label_end_index=None, bnode=None):

but implementing this change just broke the code in new ways. Could you please explain what this definition means?

Use this toolsonlile, it wortks for me https://www.pythonconverter.com/

HGHARBI avatar Oct 23 '19 23:10 HGHARBI

I found the following explanation: https://stackoverflow.com/questions/35615939/placing-python-tuples-in-function-signature

tripleee avatar Nov 09 '19 09:11 tripleee