Discussion:
[TxMt] Better Python bundle?
Russell E. Owen
2005-01-26 23:54:33 UTC
Permalink
Anyone got a bundle for python that works better? The built in one uses
bizarre colors, the folding support doesn't work properly (and, less
importantly, the nifty automatic quote closing doesn't handle """ and
''' quoted strings).

I looked at the wiki, but didn't see anything for python. Any hints on
improving python support would be appreciated.

Regards,

-- Russell
Xavier Noria
2005-01-27 08:39:30 UTC
Permalink
Post by Russell E. Owen
Anyone got a bundle for python that works better? The built in one uses
bizarre colors, the folding support doesn't work properly (and, less
importantly, the nifty automatic quote closing doesn't handle """ and
''' quoted strings).
The "elif" keyword is mispelled as well, it highlights "elsif" instead.
Sune Foldager
2005-01-27 11:11:41 UTC
Permalink
Post by Russell E. Owen
Anyone got a bundle for python that works better? The built in one uses
bizarre colors
Perhabs the person who made it will think your preferences are bizarre,
so that's hardly a question of "better" :-p.
Post by Russell E. Owen
the folding support doesn't work properly
I don't know the details, but I am pretty sure the folding support
works as good as it current can, since TM puts some limitations on it
here.
Post by Russell E. Owen
(and, less importantly, the nifty automatic quote closing doesn't
handle """ and
''' quoted strings).
I don't know what those are, but if we are talking about 'heredoc'ish
strings, spanning multiple lines, that's another limitation in TM,
since syntax rules are currently applied on a per-line basis.
Post by Russell E. Owen
I looked at the wiki, but didn't see anything for python. Any hints on
improving python support would be appreciated.
You can always have a go at it yourself as well :-).
--
Sune.
:: the Cottage of Lost Play.
:: http://cyanite.org
Chris Thomas
2005-01-27 21:21:23 UTC
Permalink
Post by Sune Foldager
Post by Russell E. Owen
(and, less importantly, the nifty automatic quote closing doesn't
handle """ and
''' quoted strings).
I don't know what those are, but if we are talking about 'heredoc'ish
strings, spanning multiple lines, that's another limitation in TM,
since syntax rules are currently applied on a per-line basis.
TextMate actually highlights these strings fine, but I think the issue
is that you'd like to type three quote marks and have TextMate do the
right thing (insert six quotes with the insertion point between the
middle pair). Right now, you end up with four quotes.

Chris
Russell E. Owen
2005-01-27 22:46:59 UTC
Permalink
Post by Sune Foldager
Post by Russell E. Owen
Anyone got a bundle for python that works better? The built in one uses
bizarre colors
Perhabs the person who made it will think your preferences are bizarre,
so that's hardly a question of "better" :-p.
I respectfully disagree.

Of the many text editors I've tried (including Qued/M, BBEdit,
CodeWarrior IDE, Pepper, Alpha, Python IDE, IDLE, XCode, JEdit, NEedit
and SubEthaEdit), only TextMate has ever used a black background by
default. Even TextMate uses a light color by default, but uses black for
python and perhaps some other languages.

Even the python bundle for TextMate has this comment:
// Somebody has a Halloween fetish.

And it isn't just the background. Once that's like, some of the other
colors also need tweaking (because they were designed -- if you can call
it that -- to be read against black). Once I realized that, I posted
this question.

Being able to customize things like this is a nice feature. But not
having "normal" behavior by default is likely to be a turnoff for
potential buyers.
Post by Sune Foldager
Post by Russell E. Owen
(and, less importantly, the nifty automatic quote closing doesn't
handle """ and
''' quoted strings).
If I type " to start a string, the program immediately adds a trailing
quote, i.e. displays "I", where I is the insertion cursor. This is neat,
but it gets a bit strange if one is starting a triple-quoted string.
It'd be cool if this smarts could be made smart enough to handle that
case well -- and that's what I was asking. Learning to live with it or
learning how to disable it are both perfectly reasonable alternatives.

-- Russell
Allan Odgaard
2005-01-27 23:05:08 UTC
Permalink
Post by Russell E. Owen
Of the many text editors I've tried (including Qued/M, BBEdit,
CodeWarrior IDE, Pepper, Alpha, Python IDE, IDLE, XCode, JEdit, NEedit
and SubEthaEdit), only TextMate has ever used a black background by
default.
Think Different is the slogan of this platform! :)
Post by Russell E. Owen
[...] But not having "normal" behavior by default is likely to be a
turnoff for potential buyers.
Tell me about it -- some doesn't even download it because of the black
background in the screenshots. Anyway, 1.1 will have style sheets, if
1.0 had reasonable defaults I wouldn't be able to make a huge deal
about this addition ;)
Post by Russell E. Owen
[...] but it gets a bit strange if one is starting a triple-quoted
string.
It'd be cool if this smarts could be made smart enough to handle that
case well -- and that's what I was asking.
I actually did not know about triple quoted strings. What are these
good for (in PYthon, that is)?
Post by Russell E. Owen
Learning to live with it or learning how to disable it are both
perfectly reasonable alternatives.
You can disable it in prefs / text editing (it's the smart typing
checkbox).

But alternatively, make a snippet with content: """$1""" and make the
trigger e.g. Ps (python string), then when you type Ps + tab it'll
expand to the triple quoting with the caret inside, and you can press
tab again (after typing your stuff) to skip the last 3 quotes.
Ollivier Robert
2005-01-28 14:12:03 UTC
Permalink
Post by Allan Odgaard
I actually did not know about triple quoted strings. What are these
good for (in PYthon, that is)?
"docstrings" which enables to give a label to a given method.
--
Ollivier ROBERT -=- FreeBSD: The Power to Serve! -=- ***@keltia.freenix.fr
Darwin snuadh.freenix.org Kernel Version 7.7.0: Sun Nov 7 16:06:51 PST 2004
Jan-Ole Esleben
2005-01-28 14:42:34 UTC
Permalink
You can use them anywhere; they're like HERE documents in Perl.

print """first line
second line
third line"""

Etc.

Actually, Doc strings are just plain strings (you can use
single-quoted strings too). They do not interfere with the code
because they simply evaluate to themselves.

Ole

On Fri, 28 Jan 2005 15:12:03 +0100, Ollivier Robert
Post by Ollivier Robert
Post by Allan Odgaard
I actually did not know about triple quoted strings. What are these
good for (in PYthon, that is)?
"docstrings" which enables to give a label to a given method.
--
Darwin snuadh.freenix.org Kernel Version 7.7.0: Sun Nov 7 16:06:51 PST 2004
______________________________________________________________________
(threading gets destroyed and the universe will collapse if you don't)
http://lists.macromates.com/mailman/listinfo/textmate
Russell E. Owen
2005-01-28 21:12:52 UTC
Permalink
Post by Jan-Ole Esleben
You can use them anywhere; they're like HERE documents in Perl.
print """first line
second line
third line"""
Etc.
Actually, Doc strings are just plain strings (you can use
single-quoted strings too). They do not interfere with the code
because they simply evaluate to themselves.
Exactly. I just wanted to add that python triple-quoted strings can use
""" or ''' as the delimiter (just as python can use " or ' as the normal
single-quoted string delimiter).

-- Russell
Fred B.
2005-01-30 01:44:44 UTC
Permalink
Post by Allan Odgaard
Post by Russell E. Owen
Of the many text editors I've tried (including Qued/M, BBEdit,
CodeWarrior IDE, Pepper, Alpha, Python IDE, IDLE, XCode, JEdit, NEedit
and SubEthaEdit), only TextMate has ever used a black background by
default.
Think Different is the slogan of this platform! :)
Post by Russell E. Owen
[...] But not having "normal" behavior by default is likely to be a
turnoff for potential buyers.
Tell me about it -- some doesn't even download it because of the black
background in the screenshots. Anyway, 1.1 will have style sheets, if
1.0 had reasonable defaults I wouldn't be able to make a huge deal
about this addition ;)
Just to balance things, the black background (and the nice ruby syntax
colors) caught my eyes first and made me download TM.
I'm spending too much time in front of a screen and, white-hurts-eyes.
So I can't wait 1.1... to make all the backgrounds dark. ;)
hadley wickham
2005-01-30 03:56:35 UTC
Permalink
I actually find it really useful to have different background colours
for different languages - it reminds me not to add trailing ;'s
everywhere!

Hadley

Loading...