Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: __setitem__ without position

Reply
Thread Tools

Re: __setitem__ without position

 
 
Ethan Furman
Guest
Posts: n/a
 
      10-11-2012
Kevin Anthony wrote:
> I'm not supprised... and understand why it's happening. I'm asking how
> to get around it.


I don't think you do understand what's happening.

What's happening is the basic application of name binding in Python:

--> C = anything

whatever C was bound to before, it no longer is, because now it is bound
to <anything>.

What you are trying to do is mutate C, not rebind it. As Dave
suggested, you can use slice notation ([:]) or some method of C (that
you create) to do so.


> Basically i'm asking how to override, if i can, the `=`


You can't.

~Ethan~
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: __setitem__ without position Peter Otten Python 0 10-12-2012 04:42 PM
Re: __setitem__ without position Ethan Furman Python 0 10-12-2012 04:16 PM
Re: __setitem__ without position Terry Reedy Python 0 10-11-2012 11:47 PM
Re: __setitem__ without position Ian Kelly Python 0 10-11-2012 10:43 PM
Re: __setitem__ without position Dave Angel Python 0 10-11-2012 09:32 PM



Advertisments