Skip to content

immutables.Map.__str__ doesn't match dict.__str__ #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rowillia opened this issue Feb 4, 2020 · 3 comments · Fixed by #58
Closed

immutables.Map.__str__ doesn't match dict.__str__ #17

rowillia opened this issue Feb 4, 2020 · 3 comments · Fixed by #58

Comments

@rowillia
Copy link

rowillia commented Feb 4, 2020

In [7]: d = {'a': 1}

In [8]: str(d)
Out[8]: "{'a': 1}"

In [9]: str(immutables.Map(d))
Out[9]: "<immutables.Map({'a': 1}) at 0x108ed56c0>"
@1st1
Copy link
Member

1st1 commented Feb 4, 2020

Yeah, I can fix this. What's the use case btw?

@rowillia
Copy link
Author

rowillia commented Feb 4, 2020

I'm replacing some dict instances with immutables.Map and we're logging the dictionary in places using __str__.

@ofek
Copy link
Contributor

ofek commented Feb 6, 2021

This would help us as well for the same exact use case.

@fantix fantix closed this as completed in #58 Feb 9, 2021
fantix added a commit that referenced this issue Feb 9, 2021
New Features

* Add support for Python 3.10 and more tests
  (by @vstinner in 45105ec for #46, @hukkinj1 in d7f3eeb, f0b4fd4)

* Make __repr__ more similar to other mapping types
  (by @ofek in 8af1502 for #17)

Misc

* Minor docs and CI fixes
  (by @MisterKeefe in 76e491c for #32, @fantix in 1282379 for #39)
@fantix fantix mentioned this issue Feb 9, 2021
fantix added a commit that referenced this issue Feb 9, 2021
New Features

* Add support for Python 3.10 and more tests
  (by @vstinner in 45105ec for #46, @hukkinj1 in d7f3eeb, f0b4fd4)

* Make __repr__ more similar to other mapping types
  (by @ofek in 8af1502 for #17)

Misc

* Minor docs and CI fixes
  (by @MisterKeefe in 76e491c for #32, @fantix in 1282379 for #39)
fantix added a commit that referenced this issue Feb 10, 2021
New Features

* Add support for Python 3.10 and more tests
  (by @vstinner in 45105ec for #46, @hukkinj1 in d7f3eeb, f0b4fd4)

* Make __repr__ more similar to other mapping types
  (by @ofek in 8af1502 for #17)

Misc

* Minor docs and CI fixes
  (by @MisterKeefe in 76e491c for #32, @fantix in 1282379 for #39)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants