Changes between Initial Version and Version 1 of Ticket #21600, comment 25


Ignore:
Timestamp:
10/05/16 14:36:25 (3 years ago)
Author:
embray
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #21600, comment 25

    initial v1  
    55> Seriously, why is that a problem? I even explicitly added a `sage_` prefix.
    66
    7 Because it's not at all clear why it's even necessary, and it only confuses things.
     71) Because it's not at all clear why it's even necessary, and it only confuses things.
     8
     92) Just because distutils is "meant to be" tinkered with in a flexible manner, monkeypatching the `Distribution` option is definitely an anti-pattern.  More commonly, if some command has some data it would like to share with other commands, the pattern is to add an attribute to that command instead (and usually at least initialize that attribute with a default value in the `finalize_command` method).  Then, if other commands need that data, they would first ensure that the command it comes from is finalized, and may also run that command if necessary (using `self.distribution.run_command`, which doesn't run the command a second time if it has already been run).  That way if command `B` uses `A.data`, it ensures that `A.data` has been generated first.
     10
     11I'm just looking out for distutils being used the way it's intended.  This is unfortunately very undocumented, but if you spend enough time in it you'll see that there are various conventions that are best to follow.  That said, I don't see why you need to add this in the first place.