Consider changing __repr__ for Arrow
See original GitHub issueHere are the current str and repr methods for Arrow.
(arrow) chris@ThinkPad:~/arrow$ python
Python 3.8.3 (default, Jul 7 2020, 18:57:36)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import arrow
>>> dt=arrow.utcnow()
>>> str(dt)
'2020-07-27T22:38:46.653869+00:00'
>>> print(dt)
2020-07-27T22:38:46.653869+00:00
>>> repr(dt)
'<Arrow [2020-07-27T22:38:46.653869+00:00]>'
__str__
should be human readable which I think is achieved, however __repr__
is designed for debugging and therefore needs to be explicit. It’s also nice (but not required) if the __repr__
can be instantiated into a new object.
This would be a breaking change so fits well for 1.0.0 if we decide to do it.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Alter the width of an annotate arrow in matplotlib
The easiest way to do this will be by using FancyBboxPatch with the darrow (double arrow) option. The one tricky part of this...
Read more >arrow/types.pxi at master · apache/arrow - GitHub
Apache Arrow is a multi-language toolbox for accelerated data interchange and in-memory processing ... return fmt.format(self, repr(self.storage_type)).
Read more >What I Learned at Work this Week: Python Arrow Library (and ...
Change the language of our timestamp. Arrow can work with various data types (date, time, datetime, tzinfo, timedelta, relativedelta, etc.) and can parse...
Read more >Use Apache Arrow to Assist PySpark in Data Processing
This article looks into how you can use Apache Arrow to Assist PySark in data processing operations and also discusses Apache Arrow and...
Read more >Apache Arrow 5.0.0 Release
Apache Arrow 5.0.0 (29 July 2021) This is a major release covering more ... ARROW-10316 - [Python] Consider using __wrapped__ for compute ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
We should aim for a
__repr__
similar to that ofdatetime
: https://stackoverflow.com/a/19597196/3820660.How about this?