memory overhead using from-import?

W

William Trenker

I'm working with an html templating application and need to escape the special characters <&>. The cgi library module has an escape function that does this but I don't need any of the other functionality of the cgi module.

Could someone please confirm that if I code the following line in my own module:
from cgi import escape
that the only additional memory overhead from the cgi module will be that required to store the escape function's code.

I was thinking of coding an escape function, but that seems silly if importing cgi.escape would consume about the same memory.

Thanks very much,
Bill
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top