I have the following namedtuple:
from collections import namedtuple
Product = namedtuple(
'Product',
'product_symbol entity unique_id as_of_date company_name followers linkedin_employees linkedin industry date_added date_updated description website sector product_industry'
)
What is the best way to declare it, so it does not exceeds the Python line limit of 80 characters?
I propose a PEP-8 compliant version which declares your attributes as a list.
name = 'Product'
attrs = [
'product_symbol',
'entity',
'unique_id',
...
]
Product = namedtuple(name, attrs)
Add a trailing comma to attrs, this makes it easy when doing diff comparisons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With