Comments (4)
Thanks @aaronspring . I'll have a look.
One thing I've found works for these is to use r"""
for docstrings. Let me see whether that works in this case. Either way, this should be a nicer experience than it currently is
from pytest-accept.
FWIW this does fix the immediate problem:
diff --git a/examples/escapes.py b/examples/escapes.py
index 97f7d2f..17f8b9d 100644
--- a/examples/escapes.py
+++ b/examples/escapes.py
@@ -1,5 +1,5 @@
def func(a, b):
- """
+ r"""
Example:
>>> import xarray as xr
>>> func(xr.DataArray([5], dims='a'), xr.DataArray([1], dims='a'))
We could at least check for the r
/ insert an r
.
But would you actually prefer that the \n
are newlines rather than \n
characters? I could imagine that's clearer.
I'm guessing this behavior is something to do with how we print the repr in xarray, since normally printing \n
does give us an actual new line:
>>> print("testing\ntesting")
testing
testing
Edit: it's that the arrays are atrs so that part is up to xarray, and xarray is probably doing the correct thing for reprs within attrs
from pytest-accept.
thanks for the r"""doc strings"""
that works
from pytest-accept.
But would you actually prefer that the \n are newlines rather than \n characters? I could imagine that's clearer.
I dont have an opinion
from pytest-accept.
Related Issues (8)
- Truncate long lines HOT 1
- Check if a file has changed before overwriting HOT 1
- Issue with docstrings containing backslashes at the end of line HOT 1
- Issue with doctest result containing escaped backslashes HOT 1
- Issue in case of excess Ellipsis `...` at the end of a multi-line doctest statement HOT 6
- Detect and redact memory addresses? HOT 1
- Long lines support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytest-accept.