In [2]:
import fnmatch
import glob
import os.path

fnmatch = fnmatch.fnmatch
escape = glob.escape
p = print
sep = os.path.sep

p(escape('.gitignore'))
p(fnmatch('.gitignore', '.gitignore'))
p(fnmatch('.vs' + sep, '.vs' + sep))
p(fnmatch('.vs' + sep, '[.]vs' + sep))


# References:
# https://stackoverflow.com/questions/22055500/python-glob-issues-with-directory-with-in-name


.gitignore
True
True
True

In [ ]: