Hierosoft / pycodetool

Code conversion tools, mostly just for removing dependencies so far. Eliminates various issues and .NET calls such as introduced by icsharpcode snippet converter C# to Python translation. NOTE: Should be rewritten to use SLY.
GNU General Public License v2.0
1 stars 1 forks source link

Change Char.IsWhiteSpace #10

Open Poikilos opened 3 years ago

Poikilos commented 3 years ago

overloads:

Example:

def IsSpace(*args):
    '''
    Sequential arguments:
    1st (args[0]) -- String to check as a whole or as a character
    2nd (args[1]) -- If present, the second param is the index in
                     args[0] to check and no other parts of args[0] will
                     be checked.
    '''
    if len(args) == 1:
        return str.isspace(args[0])
    elif len(args) == 2:
        return str.isspace(args[0][args[1]])
    raise ValueError("IsSpace only takes (charStr)"
                     " or (str, index)")