Deprecation warning on Python 3.5
See original GitHub issueGetting a deprecation warning on Python 3.5 wen importing Table and Col. It’s related to an import that doesn’t appear to be used.
Hopefully this is an easy fix.
$ cat /etc/issue
Ubuntu 16.04.1 LTS \n \l
$ uname -a
Linux nylon 4.4.0-45-generic #66-Ubuntu SMP Wed Oct 19 14:12:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from flask_table import Table, Col
/usr/local/lib/python3.5/dist-packages/flask_table/columns.py:5: ExtDeprecationWarning: Importing flask.ext.babel is deprecated, use flask_babel instead.
from flask.ext.babel import gettext as _
>>>
Issue Analytics
- State:
- Created 7 years ago
- Comments:13 (7 by maintainers)
Top Results From Across the Web
warnings — Warning control — Python 3.11.1 documentation
Base category for warnings about deprecated features when those warnings are intended for other Python developers (ignored by default, unless triggered by ...
Read more >DeprecationWarning: formatargspec is deprecated since ...
I often run our tests with -Wa to catch deprecation warnings and having this still be open in newrelic is causing extra noise....
Read more >Deprecation Warning while installing wheel for scikit-learn
It's warning you that you're using an unsupported version of Python (2.7) and should probably upgrade, otherwise you might run into problems.
Read more >Who should see Python deprecation warnings? - LWN.net
The first line filters out DeprecationWarning events, such as the warnings regarding await and async in the 3.6 release. Those warnings were also...
Read more >Using Python Console with "-Wa" raises "DeprecationWarning
Configure Python Console to use Interpreter Flag -Wa (I supplied my whole config, ... DeprecationWarning: `formatargspec` is deprecated since Python 3.5.
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 FreeTop 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
Top GitHub Comments
@palisadoes @smewp You definitely can do this with subclassing
Col
and overriding thetd
method and passing something likeattrs={'class': 'myclass'}
toelement
.This is probably fine if you just have one column that you want to add a class to, but is potentially a pain if you want to be able to apply this to a range of columns all over your application, in which case you may have to subclass every column class.
The best approach also really depends on whether the class that you’re setting on the tds for a column depends on the item, or if they’re all the same. Eg, do you want to write code that looks like:
which is pretty generic, and I would consider adding support for this.
Or code that looks like:
And that’s all application specific, so I don’t think it’ll fit so easily into flask table.
Just as an extra thought - and it depends what you’re doing - you might want to do this with CSS using
nth-child
, rather than adding classes to the tds at all.So TLDR, it really depends on your use case - whether you have one or two specific columns you want to add classes to or loads of them, and whether the classes are the same for every td in a column. I hope the above options help, or you may want to post more info about what you’re trying to create. (If so, consider opening a new issue for this.)
#71 Merged. 0.4.0 tagged and released to PyPI.