|
View:
New views
7 Messages
—
Rating Filter:
Alert me
|
|
|
Syntax highlighting for builtins?Hi,
I'm probably just missing this, but is there a way to turn on highlighting of Python builtins (i.e. "dir", "range", etc) in the WingWare IDE? I'm using version 3.1.2-1 and I can't seem to find Wingware's equivalent term for builtin in the Preferences Color dialog. Thank you for your help. Mike _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Mike Driscoll wrote:
> I'm probably just missing this, but is there a way to turn on > highlighting of Python builtins (i.e. "dir", "range", etc) in the > WingWare IDE? I'm using version 3.1.2-1 and I can't seem to find > Wingware's equivalent term for builtin in the Preferences Color dialog. Wing doesn't highlight the builtins, only keywords, so this is currently not possible. Sorry, -- Stephan Deibel Wingware | Python IDE Advancing Software Development www.wingware.com _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Hi,
Are there any plans to add support for builtins then? Or is there a plug-in that does this that some clever individual has created? I've noticed this with other Python IDE's too and wondered why IDLE seems to be the only popular one that includes builtin hightlighting. I can't be the only one who cares about accidentally shadowing a builtin. Mike Wingware Support wrote: > Mike Driscoll wrote: >> I'm probably just missing this, but is there a way to turn on >> highlighting of Python builtins (i.e. "dir", "range", etc) in the >> WingWare IDE? I'm using version 3.1.2-1 and I can't seem to find >> Wingware's equivalent term for builtin in the Preferences Color dialog. > > Wing doesn't highlight the builtins, only keywords, so this is currently > not possible. > > Sorry, > _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Mike Driscoll wrote:
> Are there any plans to add support for builtins then? Or is there a > plug-in that does this that some clever individual has created? I've > noticed this with other Python IDE's too and wondered why IDLE seems to > be the only popular one that includes builtin hightlighting. I can't be > the only one who cares about accidentally shadowing a builtin. It's not been requested before, as far as I know, so isn't in our plans yet. If you do shadow a builtin, it really doesn't matter unless you need to use the builtin in the same scope. In that case it's probably fairly obvious what's going on. For example, you could goto-definition on the name and Wing would go to your shadow's point of definition. For what it's worth, this is just not an issue I've run into in 10+ years of intensive Python programming and I'll be the first to admit that I _still_ don't really know what all the builtins are by name. I know I do shadow len, dir, file, and id fairly often and also I suspect hash, quit, and a few others as well. The only one I've started to stay away from instinctively is 'len'. Anyway, I suspect others have similar experiences and it's the reason the IDEs don't have this. IDLE may have it since it had somewhat of a teaching focus early on. -- Stephan Deibel Wingware | Python IDE Advancing Software Development www.wingware.com _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Stephen,
> Mike Driscoll wrote: >> Are there any plans to add support for builtins then? Or is there a >> plug-in that does this that some clever individual has created? I've >> noticed this with other Python IDE's too and wondered why IDLE seems >> to be the only popular one that includes builtin hightlighting. I >> can't be the only one who cares about accidentally shadowing a builtin. > > It's not been requested before, as far as I know, so isn't in our > plans yet. > > If you do shadow a builtin, it really doesn't matter unless you need > to use the > builtin in the same scope. In that case it's probably fairly obvious > what's > going on. For example, you could goto-definition on the name and Wing > would > go to your shadow's point of definition. > > For what it's worth, this is just not an issue I've run into in 10+ years > of intensive Python programming and I'll be the first to admit that I > _still_ > don't really know what all the builtins are by name. I know I do > shadow len, > dir, file, and id fairly often and also I suspect hash, quit, and a > few others > as well. The only one I've started to stay away from instinctively is > 'len'. > > Anyway, I suspect others have similar experiences and it's the reason the > IDEs don't have this. IDLE may have it since it had somewhat of a > teaching > focus early on. > It's not a big deal. It's just something that sticks out to me since I've been using IDLE extensively since I started being a Python programmer 2 years ago. While I've never had an issue with it either, I attribute that to IDLE. I have seen a couple examples of people that did have that issue when they've posted to comp.lang.py though. Thanks for the information. It's always good to know how the pros think and do things. Mike _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Wingware Support wrote:
> Mike Driscoll wrote: >> Are there any plans to add support for builtins then? Or is there a >> plug-in that does this that some clever individual has created? I've >> noticed this with other Python IDE's too and wondered why IDLE seems >> to be the only popular one that includes builtin hightlighting. I >> can't be the only one who cares about accidentally shadowing a builtin. > > It's not been requested before, as far as I know, so isn't in our > plans yet. > > If you do shadow a builtin, it really doesn't matter unless you need > to use the > builtin in the same scope. In that case it's probably fairly obvious > what's > going on. For example, you could goto-definition on the name and Wing > would > go to your shadow's point of definition. It isn't always obvious and it is an issue I have seen others encounter. Consider the following code inside the body of a method. for i in range(x): do_something() .... more code range = GetRange() When executed, the *first* use of range blows up with an 'UnboundLocalError', since range is now an unbound local variable rather than a builtin. As the exception doesn't occur at the point of the problem it can be confusing if you don't know what is going on. FWIW, detecting builtin shadowing is one of the things we use PyLint for. Michael Foord > > For what it's worth, this is just not an issue I've run into in 10+ years > of intensive Python programming and I'll be the first to admit that I > _still_ > don't really know what all the builtins are by name. I know I do > shadow len, > dir, file, and id fairly often and also I suspect hash, quit, and a > few others > as well. The only one I've started to stay away from instinctively is > 'len'. > > Anyway, I suspect others have similar experiences and it's the reason the > IDEs don't have this. IDLE may have it since it had somewhat of a > teaching > focus early on. > -- http://www.ironpythoninaction.com/ http://www.voidspace.org.uk/ http://www.trypython.org/ http://www.ironpython.info/ http://www.theotherdelia.co.uk/ http://www.resolverhacks.net/ _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
|
|
Re: Syntax highlighting for builtins?Michael Foord wrote:
> <div class="moz-text-flowed" style="font-family: -moz-fixed">Wingware > Support wrote: >> Mike Driscoll wrote: >>> Are there any plans to add support for builtins then? Or is there a >>> plug-in that does this that some clever individual has created? I've >>> noticed this with other Python IDE's too and wondered why IDLE seems >>> to be the only popular one that includes builtin hightlighting. I >>> can't be the only one who cares about accidentally shadowing a builtin. >> >> It's not been requested before, as far as I know, so isn't in our >> plans yet. >> >> If you do shadow a builtin, it really doesn't matter unless you need >> to use the >> builtin in the same scope. In that case it's probably fairly obvious >> what's >> going on. For example, you could goto-definition on the name and >> Wing would >> go to your shadow's point of definition. > > It isn't always obvious and it is an issue I have seen others encounter. > > Consider the following code inside the body of a method. > > for i in range(x): > do_something() > > .... more code > > range = GetRange() > > When executed, the *first* use of range blows up with an > 'UnboundLocalError', since range is now an unbound local variable rather > than a builtin. As the exception doesn't occur at the point of the > problem it can be confusing if you don't know what is going on. > > FWIW, detecting builtin shadowing is one of the things we use PyLint for. > > Michael Foord > > Thanks for that. This is similar to what I've seen on c.l.py from time to time, which is why I was hoping that Wingware had builtins highlighted too. I showed the Wingware IDE to my boss and he thinks it looks good too, but has reservations about buying it for himself because of the lack of builtin highlighting. Mike _________________________________________________ Wing IDE users list http://wingware.com/lists/wingide |
| Free Forum Powered by Nabble | Forum Help |