Title: tabulate() raises TypeError when rowalign is passed as a tuple instead of a list · Issue #434 · astanin/python-tabulate · GitHub
Open Graph Title: tabulate() raises TypeError when rowalign is passed as a tuple instead of a list · Issue #434 · astanin/python-tabulate
X Title: tabulate() raises TypeError when rowalign is passed as a tuple instead of a list · Issue #434 · astanin/python-tabulate
Description: Description tabulate(...) raises TypeError when rowalign (or maxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers, colalign, floatfmt, maxcolwidths, ...) accepts a tuple. ...
Open Graph Description: Description tabulate(...) raises TypeError when rowalign (or maxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers, colalign, floatf...
X Description: Description tabulate(...) raises TypeError when rowalign (or maxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers, colalign, floatf...
Opengraph URL: https://github.com/astanin/python-tabulate/issues/434
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"tabulate() raises TypeError when rowalign is passed as a tuple instead of a list","articleBody":"### Description\n\n`tabulate(...)` raises `TypeError` when `rowalign` (or `maxheadercolwidths`) is passed as a **tuple** instead of a list, even though every other sequence-valued parameter (`headers`, `colalign`, `floatfmt`, `maxcolwidths`, ...) accepts a tuple.\n\n### Reproduction\n\n```python\nfrom tabulate import tabulate\n\ntabulate([[1, 2], [3, 4]], rowalign=(\"top\", \"bottom\"))\n# TypeError: can only concatenate tuple (not \"list\") to tuple\n\ntabulate([[1, 2], [3, 4]], rowalign=[\"top\", \"bottom\"]) # works\n```\n\n### Root cause\n\nThe internal sequence-padding helper does `original + [default] * (num_desired - len(original))`. When `original` is a tuple this is `tuple + list`, which raises (and it raises even when no padding is needed, since `tuple + []` still fails). Coercing with `list(original)` first fixes it and matches how the other parameters behave.\n","author":{"url":"https://github.com/pramodavansaber","@type":"Person","name":"pramodavansaber"},"datePublished":"2026-06-29T01:38:21Z","url":"https://github.com/astanin/python-tabulate/issues/434"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:463888b6-ad9c-0d59-1640-ad06e13313ca |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8638:14B595:3BFE81:53FBC7:6AFF299E |
| html-safe-nonce | 7ceb5770bde95e95cc3470b4d95772d06d7e0811d01994a5f0bc8d0567f2bc31 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjM4OjE0QjU5NTozQkZFODE6NTNGQkM3OjZBRkYyOTlFIiwidmlzaXRvcl9pZCI6IjQ4NTU4NTk2NjU1Mjg4OTE4MDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 59d1edfeb9aa943550aff9c327970d8de29d00b8b941b5a0217dcbe9cf313946 |
| hovercard-subject-tag | issue:4764371886 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/astanin/python-tabulate/434/issue_layout |
| twitter:image | https://opengraph.githubassets.com/58769796882b6bb9acc85b469f921790a735a516605b79ff03b1b45bec312e44/astanin/python-tabulate/issues/434 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/58769796882b6bb9acc85b469f921790a735a516605b79ff03b1b45bec312e44/astanin/python-tabulate/issues/434 |
| og:image:alt | Description tabulate(...) raises TypeError when rowalign (or maxheadercolwidths) is passed as a tuple instead of a list, even though every other sequence-valued parameter (headers, colalign, floatf... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | pramodavansaber |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2ff2d37f6b6f9a9c91f18d54cf30d0d9e07d017eaab345cd5e6fb05715e02284 |
| turbo-cache-control | no-preview |
| go-import | github.com/astanin/python-tabulate git https://github.com/astanin/python-tabulate.git |
| octolytics-dimension-user_id | 71802 |
| octolytics-dimension-user_login | astanin |
| octolytics-dimension-repository_id | 205875548 |
| octolytics-dimension-repository_nwo | astanin/python-tabulate |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 205875548 |
| octolytics-dimension-repository_network_root_nwo | astanin/python-tabulate |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9bfe6f375bb68c197004966721f6e7a3a0843cf5 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width