Skip to content

String encoding when caching in internal structures #178

@MothScientist

Description

@MothScientist
import sys

var_1 = 'en'
var_2 = 'en'.encode('utf-8')

size1 = sys.getsizeof(var_1)
size2 = sys.getsizeof(var_2)
print(f"Size var_1: {size1} bytes")
print(f"Size var_2: {size2} bytes")

Output:
Size var_1: 51 bytes
Size var_2: 35 bytes

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestsecurityApplication security issues

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions