On Apr 3, 11:10 am, João Neves <[EMAIL PROTECTED]> wrote:
> On Apr 3, 4:43 am, Scott David Daniels <[EMAIL PROTECTED]> wrote:
>
> > Nope: If you change the code in-place, the whole stack's references
> > to where they were running would need to get updated to corresponding
> > locations in the new
João Neves wrote:
> Let me give a very basic example. Say we have these two functions:
I suppose you mean
>>> def inc(x): return x + 1
...
>>> def dec(x): return x - 1
...
>>> inc(1), dec(1)
(2, 0)
> Examining the compiled bytecodes for these two functions:
>
> >>> inc.func_code.co_code
> '|\
On Apr 3, 4:43 am, Scott David Daniels <[EMAIL PROTECTED]> wrote:
> Nope: If you change the code in-place, the whole stack's references
> to where they were running would need to get updated to corresponding
> locations in the new code. _That_ is a lot of work.
Ah, there it is. Now I get it, it
Dan Upton wrote:
>> The thing I've been wondering is why _is_ it read-only? In what
>> circumstances having write access to co_code would break the language
>> or do some other nasty stuff?
>>
>> João Neves
>
> I can't speak to Python's implementation in particular, but
> self-modifying code i
João Neves wrote:
> On 2 Abr, 21:38, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> On Wed, Apr 2, 2008 at 2:33 PM, João Neves <[EMAIL PROTECTED]> wrote:
>>> On Apr 2, 5:41 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote:
>>> > > The thing I've been wondering is why _is_ it read-only? In what
>>> > > c
En Wed, 02 Apr 2008 17:54:33 -0300, João Neves <[EMAIL PROTECTED]>
escribió:
> On 2 Abr, 21:38, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
>> There is no need to overwrite co_code. Create a new code object with
>> your desired bytecode and use that instead.
>
> Yes, it may work (haven't tested -
On 2 Abr, 21:38, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
> On Wed, Apr 2, 2008 at 2:33 PM, João Neves <[EMAIL PROTECTED]> wrote:
> > On Apr 2, 5:41 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote:
> > > > The thing I've been wondering is why _is_ it read-only? In what
> > > > circumstances having w
On Wed, Apr 2, 2008 at 2:33 PM, João Neves <[EMAIL PROTECTED]> wrote:
> On Apr 2, 5:41 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote:
> > > The thing I've been wondering is why _is_ it read-only? In what
> > > circumstances having write access to co_code would break the language
> > > or do some
On Apr 2, 5:41 pm, "Dan Upton" <[EMAIL PROTECTED]> wrote:
> > The thing I've been wondering is why _is_ it read-only? In what
> > circumstances having write access to co_code would break the language
> > or do some other nasty stuff?
>
> > João Neves
>
> I can't speak to Python's implementation
On Apr 2, 11:41 am, "Dan Upton" <[EMAIL PROTECTED]> wrote:
> > The thing I've been wondering is why _is_ it read-only? In what
> > circumstances having write access to co_code would break the language
> > or do some other nasty stuff?
>
> > João Neves
>
> I can't speak to Python's implementatio
> The thing I've been wondering is why _is_ it read-only? In what
> circumstances having write access to co_code would break the language
> or do some other nasty stuff?
>
> João Neves
I can't speak to Python's implementation in particular, but
self-modifying code in general is unpleasant. It
> I'm not quite sure I understood your question, sorry.
And you won't. He's one of the resident trolls... Better killfile him
ASAP :)
Diez
--
http://mail.python.org/mailman/listinfo/python-list
On Apr 2, 4:35 pm, [EMAIL PROTECTED] wrote:
> Are Python bytes codes Python byte codes?
I'm not quite sure I understood your question, sorry.
> Do you foresee any machine-dependent optimizations?
In my personal case, I am not looking for optimizations in the
generated bytecode.
Let me give a ve
On Apr 2, 5:00 am, João Neves <[EMAIL PROTECTED]> wrote:
> Hello all,
>
> I've got this question that has been nagging me for a few days now.
> What are the reasons for us to have co_code as read-only? I've been
> trying to get some info about it, but I kept hitting the wall.
>
> Correct me if I'm
Hello all,
I've got this question that has been nagging me for a few days now.
What are the reasons for us to have co_code as read-only? I've been
trying to get some info about it, but I kept hitting the wall.
Correct me if I'm wrong, but as far as I understand, co_code
represents the compiled by
15 matches
Mail list logo