Skip to content

More about hidden memory #3

@noviluni

Description

@noviluni

That's not a issue with the project but a question for you about a snippet that could be in the README.

I know another case which I think is related with your "hidden memory" snippet, but I can't understand why it happens.

>>> x = 'a'*20
>>> y = 'a'*20
>>> x is y
True

>>> x = 'a'*21
>>> y = 'a'*21
>>> x is y
False

And then, if we create directly a string with more than 20 equals characters:

>>> x = 'aaaaaaaaaaaaaaaaaaaaaaaaa'
>>> y = 'aaaaaaaaaaaaaaaaaaaaaaaaa'
>>> x is y
True

It seems that they are identical.

Do you know why it happens?

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions