MCPcopy Index your code
hub / github.com/python/cpython / separate

Function separate

Lib/zipfile/_path/glob.py:104–113  ·  view source on GitHub ↗

Separate out character sets to avoid translating their contents. >>> [m.group(0) for m in separate('*.txt')] ['*.txt'] >>> [m.group(0) for m in separate('a[?]txt')] ['a', '[?]', 'txt']

(pattern)

Source from the content-addressed store, hash-verified

102
103
104def separate(pattern):
105 """
106 Separate out character sets to avoid translating their contents.
107
108 >>> [m.group(0) for m in separate('*.txt')]
109 ['*.txt']
110 >>> [m.group(0) for m in separate('a[?]txt')]
111 ['a', '[?]', 'txt']
112 """
113 return re.finditer(r'([^\[]+)|(?P<set>[\[].*?[\]])|([\[][^\]]*$)', pattern)

Callers 1

translate_coreMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…