[PATCH v2] dts: type hints updated for method arguments and return types

Luca Vizzarro Luca.Vizzarro at arm.com
Mon Aug 11 12:13:06 CEST 2025


On 08/08/2025 21:49, Andrew Bailey wrote:
> Thank you Luca for the review,
> 
> Regarding the changes to the enum in utils.py, adding type hints to the 
> extension method revealed an underlying issue with its interaction with 
> mypy. Using self.none.value within the return fstring causes an error 
> and I will send the details over slack shortly. I had tried to get 
> around this by not calling value on none but could not maintain the 
> functionality of this method while simultaneously keeping mypy happy. 
> Within my patch is the only solution that I had that worked, where 
> calling self.tar.value was fine with the linter when using auto().
> 
> Regards,
> Andrew

Oh I see,

In cases like these the problem is not changing up the current 
definitions :D, but figure out why the problem is happening.

It looks like this is happening because we are trying to access another 
enum member from the instance instead of the class. This should solve it:

   none = type(self).none

for readability's sake you can also split it across multiple lines 
instead of the inline if.

A note for future replies, a mailing list should be treated like an 
online forum. If we quote the entire message, and that message also has 
more quotes under it, the thread will become quite congested and hard to 
read. On forums we quote a part of the post and reply directly beneath 
it, as it follows the logical reading order. This is referred to as 
bottom posting. There is also the part where a lot of junk will fill up 
the mailing list archive and the maintainers won't be happy. There is 
this resource which is concise that I highly recommend:

   https://useplaintext.email

When you have the time please review the kernel's contribution 
guidelines on which the DPDK contribution guidelines expand on:

   https://www.kernel.org/doc/html/latest/process/submitting-patches.html

Best regards,
Luca


More information about the dev mailing list