Message127799
| Author |
belopolsky |
| Recipients |
belopolsky, benjamin.peterson |
| Date |
2011年02月03日.17:21:42 |
| SpamBayes Score |
3.121626e-07 |
| Marked as misclassified |
No |
| Message-id |
<AANLkTimaGRZYef8mGC0zRY30yFHG_WGQnf97Upy2Wa0U@mail.gmail.com> |
| In-reply-to |
<AANLkTikas2vtwjRCKKLzjjjHSL+9KDx_9BYWU6AMvhRJ@mail.gmail.com> |
| Content |
On Thu, Feb 3, 2011 at 12:08 PM, Benjamin Peterson
<report@bugs.python.org> wrote:
..
>> I wonder: Why ast nodes need to be mutable?
>
> So people can change them.
Well, they are hashable, so this needs to be done carefully. Is this
necessary for AST-based optimizations? Does Python actually change
AST after it has been created? Note that for some optimizations it
may be more appropriate to build a new tree rather than mutate the old
one. Depending on the algorithm, you may or may not need to change
the nodes after they have been created in the process. |
|