When electric-pair-mode is enabled, a single quote ' should be auto completed to be '' (which means an empty string). Python-mode correctly does this, but python-ts-mode does not. This is clearly a problem regarding the syntax table. The attached patch makes python-ts-mode uses the same syntax table as python-mode's, and fixes this problem. I also checked a few other ts modes, and some also have this issue. For example, js-ts-mode does not auto complete '' either, which is also fixed by this patch.