(Python) use genc's string switch for minor performance improvement