开发者

Does Scala offer functionality similar to Pretty Print in Python?

开发者 https://www.devze.com 2023-02-27 07:13 出处:网络
Does Scala offer function开发者_StackOverflowality similar to Pretty Print pprint in Python?No, it doesn\'t. Except for XML, that is -- there\'s a pretty printer for that, which generates interpreter-

Does Scala offer function开发者_StackOverflowality similar to Pretty Print pprint in Python?


No, it doesn't. Except for XML, that is -- there's a pretty printer for that, which generates interpreter-readable data.

In fact, it doesn't even have a way to print interpreter-readable data, mainly because of how strings are represented when converted to string. For instance, List("abc").toString is List(abc).

Add to that, there's no facility at all that will break them based on width, or ident nested collections.

That said, it is doable, within the same limits as pprint.

0

精彩评论

暂无评论...
验证码 换一张
取 消