Lunderberg commented on PR #16844:
URL: https://github.com/apache/tvm/pull/16844#issuecomment-2036062916

   Overall, to remove a repeated source of bugs.  Since most functions are 
publicly exposed, they'll have at least the `"global_symbol"` attribute.  
Frequently, utilities would be written that only worked for functions that had 
non-empty attributes.  For example, checking `if 'my_attribute' in func.attrs` 
instead of `if func.attrs is not None and 'my_attribute' in func.attrs`.  These 
instances could look reasonable for quite some time, until a function that 
happens to have no attributes would trigger the bug.
   
   This class of bug was only possible because we had two entirely separate 
ways to represent "has no attributes".  Changing the default from `None` to an 
empty `DictAttrs` removes the opportunity for these bugs to occur.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to