请教执行顺序
刚刚接触python,请教一个菜鸟的问题,下面:
def split(pattern, string, maxsplit=0, flags=0):
"""Split the source string by the occurrences of the pattern,
returning a list containing the resulting substrings."""
return _compile(pattern, flags).split(string, maxsplit)
_compile 和split 的执行顺序是什么?先_compile还是split?
偶是做C的。
[解决办法]
应该是跟C++一样的,先执行compile生成一个对象,然后执行该对象的split方法
[解决办法]
从左向右