Wrapper function to handle padding operations
(
self,
*,
func: Callable,
width: int | Any,
fillchar: str | bytes | Any = " ",
)
| 1327 | return func(width=width, fillchar=fillchar) |
| 1328 | |
| 1329 | def _padder( |
| 1330 | self, |
| 1331 | *, |
| 1332 | func: Callable, |
| 1333 | width: int | Any, |
| 1334 | fillchar: str | bytes | Any = " ", |
| 1335 | ) -> T_DataArray: |
| 1336 | """ |
| 1337 | Wrapper function to handle padding operations |
| 1338 | """ |
| 1339 | fillchar = self._stringify(fillchar) |
| 1340 | |
| 1341 | def overfunc(x, iwidth, ifillchar): |
| 1342 | if len(ifillchar) != 1: |
| 1343 | raise TypeError("fillchar must be a character, not str") |
| 1344 | return func(x, int(iwidth), ifillchar) |
| 1345 | |
| 1346 | return self._apply(func=overfunc, func_args=(width, fillchar)) |
| 1347 | |
| 1348 | def center( |
| 1349 | self, width: int | Any, fillchar: str | bytes | Any = " " |
no test coverage detected