Re: Favorite non-python language trick?

2005-06-30 Thread Brian Elmegaard
Joseph Garvin <[EMAIL PROTECTED]> writes: > I'm curious -- what is everyone's favorite trick from a non-python > language? Metapost solution of linear equations: x1+9=x2-8=2; > And -- why isn't it in Python? I'd like to know too. -- Bri

Re: Scipy - Latex Annotations in plots

2005-07-08 Thread Brian Elmegaard
is the best 3d-lib for that, afaik. The good thing is that you get plot that work in both latex and pdflatex and integrates completely with latex text. -- Brian (remove the sport for mail) http://www.et.web.mek.dtu.dk/Staff/be/be.html -- http://mail.python.org/mailman/listinfo/python-list

Python Programming Contest

2005-07-15 Thread Brian Quinlan
e first problem here: http://www.sweetapp.com/pycontest/contest1 I'm always looking for feedback, so let me know what you think or if you have any ideas for future problems. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
Module loading is done before the test is run. Also, it is easiest to protect my system against malicious code if it is being run on an OS without a writeable filesystem. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Brian> I've decided that it would be be fun to host a weekly Python > Brian> programming contest. The focus will be on algorithms that require > Brian> a bit of thought to design but not much code to implement. > > For some o

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
Bill Mill wrote: > On 7/15/05, Brian Quinlan <[EMAIL PROTECTED]> wrote: > >>[EMAIL PROTECTED] wrote: >> >>>Brian> I've decided that it would be be fun to host a weekly Python >>>Brian> programming contest. The focus will be on algo

Re: Python Programming Contest

2005-07-15 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: > Brian> This contest is for people who like thinking about algorithms. > > Surely you must have missed the smiley... No, I saw it but it just confused me as I have no sense of humor. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-18 Thread Brian Quinlan
which is preferred? The first option (day 3 for 390 units). > P.S. I just realized this may be answered be the test suite, but I'm > still at the thinking stage. No problem. Let me know if you have any other questions. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-19 Thread Brian Quinlan
t; What would the solution be? And for how much in total? There are two correct solutions: ["A", "B"] # spend one night in A, then fly to B on day two (cost 80) ["A", "A", "B"] # spend two nights in A, then fly to B on day two (cost 80) Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-19 Thread Brian Quinlan
would be, I fly from A to B for 40 bucks on day 3, > assuming I live in the current city A. Then you should assume that you don't live in city A, because the actual cost in this case is 80. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest

2005-07-20 Thread Brian Quinlan
ution of the random schedule so as not to be biased against some solutions. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

REMINDER: Python Contest

2005-07-22 Thread Brian Quinlan
resource for people looking for best practice examples and also for people looking for performance ideas. You can find the first problem here: http://www.sweetapp.com/pycontest/contest1 I'm always looking for feedback, so let me know what you think or if you have any ideas for future problems.

subscribe

2005-07-26 Thread Brian Lee
Subscribe   Thanks, Brian Lee   -- http://mail.python.org/mailman/listinfo/python-list

Re: string methods

2005-07-30 Thread Brian Beck
ar" py> s[:3] 'foo' py> s[:3] + "B" + s[4:] 'fooBar' py> -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: [path-PEP] Path inherits from basestring again

2005-07-30 Thread Brian Beck
Ivan Van Laningham wrote: > I like / as a shortcut to joinwith(). I like it a lot. I like it so > much I'll give you a +2. +1 here. Extremely practical. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Python Programming Contest: First results

2005-08-01 Thread Brian Quinlan
in less than 3 hours after the contest was announced. That's impresive for a correct solution. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting not derived members of a class

2005-08-01 Thread Brian Beck
#x27;s __mro__ solution returns the bases in reverse order than what you requested (in your example, you said B should come last). So use list(reversed(z.__class__.__mro__)) or z.__class__.__mro__[::-1] -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Path as a dictionary tree key? (was Re: PEP on path module for standard library)

2005-08-01 Thread Brian Beck
siblings of X and B (subpaths of B and A). -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Application Error (referenced error)

2005-08-01 Thread Brian Beck
get Zope up and running before you can use Plone. See www.zope.org. There are also specific mailing lists (on Gmane, www.gmane.org) dedicated to Zope, Plone, and their related packages. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Application Error (referenced error)

2005-08-01 Thread Brian Beck
David Blomstrom wrote: > This is my first post on this list, and I'm new to > Python. Oh, and I forgot to mention: welcome to Python and our community! -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest: First results

2005-08-02 Thread Brian Quinlan
te. I'll do it tomorrow. > Where do the timing results come from? Is it the number that > fly_test.main(['fly']) outputs? I don't think it is that because with my > solution that would be ~0.06 seconds. This is the time required to do several thousand trials. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Python Programming Contest: First results

2005-08-03 Thread Brian Quinlan
Brian Quinlan wrote: > Tomi Kyöstilä wrote: > >Why don't I see my solution (__author__ = "dOb") in the results? I'm >sure that you got it as you replied to my mail. Your solution is now included. See: http://www.sweetapp.com/pycontest/contest1/results.html G

Re: Python Programming Contest: First results

2005-08-03 Thread Brian Quinlan
Tomi Kyöstilä wrote: > Any idea when the next competition is coming? (it hasn't been quite > weekly as you hoped, eh? ;) Uh no. It turns out that I have less time than I thought, though a big chunk of it should be freed-up after this weekend. I do have an idea... :-) Cheers, Bri

Re: Python -- (just) a successful experiment?

2005-08-07 Thread Brian Beck
here is such a huge counter-example of "the best technology wins" staring everyone in the face every day, that the first part of your post doesn't really do anything for me. But ultimately I am on your side. Python has a long way to go, and it has nothing to do with the language

Re: What are modules really for?

2005-08-11 Thread Brian Quinlan
tion that operates on the > "collection of all instances" rather than a single instance. Really? What instances do the static methods in the Java Math class operate on? Not Math instances, of course. So what is the rational for them being packaged in the Math class? Cheers, Brian -- h

Re: Writing a small battleship game server in Python

2005-08-11 Thread Brian Quinlan
...'] >>> s.get_my_board(token) # blocks until other guy shoots ['...pppa...', '..a...', '.da...', '.dA.ss', # uppercase if hit '.da...']) Just designed in 2 minutes - but you get the idea. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Wheel-reinvention with Python

2005-08-15 Thread Brian Victor
when I have never found that to be the case. -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: [newbie]search string in tuples

2005-08-20 Thread Brian Victor
what you want: vehicles = ("airplane", "car", "boat") select = vars while select not in vehicles: select=raw_input("Wich vehicle?") -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: minimalist regular expression

2005-08-26 Thread Brian McCauley
Paul Lalli wrote: > > m//; > > it matches everything. Not in Perl it doesn't. :-) -- http://mail.python.org/mailman/listinfo/python-list

Re: Jargons of Info Tech industry

2005-08-26 Thread Brian Raiter
> I know this is entirely inappropriate and OT, [...] Yeah -- unlike the rest of this misbegotten thread, which is right bang on-topic for all five newsgroups and is not suffering at all from topic drift, no not in the least. b -- http://mail.python.org/mailman/listinfo/python-list

Re: xmlrcp register classes

2005-09-05 Thread Brian Quinlan
> only one being exported. How can I register all the classes? Thanks. class MyCombinedClass(MyClass1, MyClass2, MyClass3): pass Server.register_instance(MyCombinedClass()) Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-12 Thread Brian Quinlan
it (possible race condition) o the system doesn't have sufficient resources to open the file e.g. too many open file handles o the file is already open with exclusive read/write permission Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: First release of Shed Skin, a Python-to-C++ compiler.

2005-09-13 Thread Brian Quinlan
to debug. If you look at the Python C source, you'll notice that probably 50% of the code is devoted to error handling (that was a guess). Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

How to quit a Tkinter application

2005-02-10 Thread Brian Colfer
Title: Message If I set up a menu item to Exit and use root.quit the application quits but I get a thread terminated abnormaly error.   BTW I'm using Pmw to create the menu and items.   primary email: [EMAIL PROTECTED]blog: http://briancolferblog.blogspot.com/M

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread Brian Quinlan
at it is a for-all symbol in big-endian format? For more details, see: http://www.unicode.org/faq/utf_bom.html#BOM Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Is this a bug? BOM decoded with UTF8

2005-02-11 Thread Brian Quinlan
S}r' ... .encode('utf-8').decode('latin1').encode('latin1') 'T\xc3\xbcr' I can assume you that most Germans can differentiate between "Tür" and "Tã¼r". Using a BOM with UTF-8 makes it easy to indentify it as such AND it shouldn

Re: Iterate through dictionary of file objects and file names

2005-02-12 Thread Brian Beck
ot;File not found: %s" % fileName # To close optionalFiles... for fileName, fileObject in optionalFiles.iteritems(): if fileObject: fileObject.close() print "Closed: %s" % fileName # Rebinding fileObject here won't modify the dictionary,

Re: Iterate through dictionary of file objects and file names

2005-02-12 Thread Brian Beck
son actually using it. So string substitution makes it more flexible; less work for them. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin functions for and and or?

2005-02-13 Thread Brian Beck
(x) is True for every element in the iterable" for elem in ifilterfalse(pred, seq): return False return True def any(seq, pred=bool): "Returns True if pred(x) is True for at least one element in the iterable" for elem in ifilter(pred, seq): return True

Re: builtin functions for and and or?

2005-02-13 Thread Brian Beck
Brian Beck wrote: def all(seq, pred=bool): "Returns True if pred(x) is True for every element in the iterable" for elem in ifilterfalse(pred, seq): return False return True def any(seq, pred=bool): "Returns True if pred(x) is True for at least one element i

Re: builtin functions for and and or?

2005-02-13 Thread Brian Beck
r x in ['a', '', 'b', 'c'])) False py> bool(min(bool(x) for x in ['a', 'b', 'c', 'd'])) True -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin functions for and and or?

2005-02-13 Thread Brian Beck
onsidering I have to do stuff like this on a daily basis! Ignore mine except as a novelty, then. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: builtin functions for and and or?

2005-02-13 Thread Brian Beck
nd don't require the setup of a try/except/else. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: [EVALUATION] - E02 - Support for MinGW Open Source Compiler

2005-02-14 Thread Brian Beck
development work to enhance the standard Python distribution IS volunteering. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: super not working in __del__ ?

2005-02-16 Thread Brian Beck
t wizardly enough to comment on. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting milliseconds in Python

2005-02-16 Thread Brian Beck
mjs7231 wrote: This is no good, I am looking for milliseconds, not seconds.. as stated above. That IS what you want. seconds * 100 = milliseconds -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting milliseconds in Python

2005-02-16 Thread Brian Beck
Fredrik Lundh wrote: Brian Beck wrote: That IS what you want. seconds * 100 = milliseconds are you sure you know what a millisecond is? (duck) Touché. But it was a typo. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting milliseconds in Python

2005-02-17 Thread Brian Beck
he does have to *multiply* by a thousand to get the number of milliseconds. 2 seconds * 1000 = 2000 milliseconds So, aside from the 100 in the original post, it may look misleading, but that is what he would need to do... -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/

Re: Getting milliseconds in Python

2005-02-17 Thread Brian Beck
Martin Christensen wrote: A math teacher! A math teacher! My kingdom for a math teacher! Martin Man, this is the hottest topic on c.l.py since that Lazaridis guy... -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Brian Beck
x27;word' totalled over all selected dicts doesn't exceed a given MAX_VALUE. Right now, I do this by: Not that you can't still improve performance of course, but this is an NP-complete problem if you didn't know, so don't bang your head too hard... -- Brian

Re: selecting dictionaries to maximize counts

2005-02-18 Thread Brian Beck
um problem.' http://en.wikipedia.org/wiki/Subset_sum_problem http://en.wikipedia.org/wiki/Knapsack_problem -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread Brian Beck
pairs: p = set(pairings.pop()) remove = set([]) for pair in pairs: pairSet = set(pair) if pairSet & p: p |= pairSet remove.add(pair) pairs -= remove merged.append(list(p)) return merged -- Brian

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread Brian Beck
Brian Beck wrote: > [code] Whoops, that should say: def merge(pairs): pairs = set(tuple(sorted(p)) for p in pairs) merged = [] # Each loop will result in a new, complete sublist in the result. while pairs: p = set(pairs.pop()) remove = set([]) for pair

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread Brian Beck
Brian Beck wrote: Brian Beck wrote: > [code] Ah heck, nevermind... it worked for my small test cases but the algorithm is just wrong. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] exercise: partition a list by equivalence

2005-02-18 Thread Brian Beck
removePairs.add(pair) # Mark pair for removal if removePairs: pairList -= removePairs else: merged.append(list(subList)) return merged -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: [perl-python] exercise: partition a list by equivalence

2005-02-19 Thread Brian Beck
) for s in sets if s] # Comparison import profile import random # Play with these values xMax, nPairs = 1000, 5000 l = [[random.randint(0, xMax), random.randint(0, xMax)] for i in range(nPairs)] print 'merge2:' profile.run('merge2(l)') # Mine print 'merge:' profile.ru

Re: Moving to Python from PHP - 3 questions

2005-02-20 Thread Brian Beck
ant; and that's not necessarily a good thing. Vampire points you in a nice direction (I don't want to say 'the right' direction). -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Moving to Python from PHP - 3 questions

2005-02-20 Thread Brian Beck
Maybe this can help you get it working on OS X: http://thread.gmane.org/gmane.comp.python.mod-python/4039 But as stated in my other post, you may want to take a look at your other options first. Web development with Python is really nothing like PHP, unless you really want it to be. -- Brian

Re: python2.4 generator expression > python2.3 list expression

2005-02-21 Thread Brian Beck
should result in the number unchanged. As his tests show, this is not the case. This is because the operation works only if the least significant bit actually NEEDS to be unset. To zero the least significant bit unconditionally, we can use: x &= ~1 -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Sizers VS window size

2005-02-22 Thread Brian Victor
ndow to match the sizer's minimal size." Take this call out and the size should be as you expect. -- Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie help for mod_python

2005-02-22 Thread Brian Beck
something resembling: LoadModule python_module modules/mod_python.so -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

web status display for long running program

2005-02-24 Thread Brian Roberts
oid them if possible. Or is there a better/different way of doing this? Any general advice or pointers to some code that already does this would be very much appreciated. Python 2.3, under both Linux & Windows if that makes a difference. Thanks, Brian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Making a calendar

2005-02-26 Thread Brian Sutherland
do > this) > > Then I need a script that puts the events from the db into the calendar, if > every day in the calendar has a value id that part will not be hard. All this and more (perhaps overkill): http://www.schooltool.org/schoolbell -- Brian Sutherland It's 10 minutes,

Re: best XSLT processor?

2005-02-28 Thread Brian Quinlan
said it is buggy (lots of work arounds)? Others ??? You could try Pyana (pyana.sourceforge.net). It's a binding to the Apache Group's Xalan engine. I don't think that it is a flexable as 4Suite but it is probably faster and more standards compliant (it was the last time that I c

Re: Small but significant memory leak in Pyana XSLT processor

2005-03-08 Thread Brian Quinlan
he problem youself. Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: looking for way to include many times some .py code from anotherpython code

2005-03-08 Thread Brian Roberts
ry different than, say, C or C++, which has separate include and execute steps. In general, you want to either use the built-in lists and dicts, or create classes/objects to represent hundreds of things. Brian. -- http://mail.python.org/mailman/listinfo/python-list

Re: Small but significant memory leak in Pyana XSLT processor

2005-03-09 Thread Brian Quinlan
need to call parseSource when the XML is different for each iteration, that solves my problem, but the parseSoruce function should free all memory anyways. Yes it should. It's not obvious to me why it doesn't. I'll investage it in detail a bit later. Cheers, Brian -- http://mai

Turning String into Numerical Equation

2005-03-12 Thread Brian Kazian
erent mathematical rules. Does anyone have a better idea than parsing to compute an equation from a string representation? Thanks so much! Brian Kazian -- http://mail.python.org/mailman/listinfo/python-list

Re: Turning String into Numerical Equation

2005-03-12 Thread Brian Kazian
Thanks for the help, I didn't even think of that. I'm guessing there's no easy way to handle exponents or logarithmic functions? I will be running into these two types as well. "Artie Gold" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Brian

Re: Turning String into Numerical Equation

2005-03-13 Thread Brian Kazian
Wow, thanks so much guys! "Michael Spencer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Brian Kazian wrote: >> Thanks for the help, I didn't even think of that. >> >> I'm guessing there's no easy way to handle exponents o

Re: [perl-python] unicode study with unicodedata module

2005-03-15 Thread Brian McCauley
Xah Lee wrote: i don't know what's the state of Perl's unicode. perldoc perlunicode -- http://mail.python.org/mailman/listinfo/python-list

Re: py.test anyone?

2004-11-30 Thread Brian Beck
to change precedence or to clear search term ambiguity. These are likewise completely ignored. ;) Have a helpful day. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: IMAP UTF-7, any codec for that anywhere?

2004-12-01 Thread Brian Quinlan
code('utf-7') '+AP8-' Cheers, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: The python2.4 IDLE can't be lanuched.

2004-12-06 Thread Brian Beck
ve it? Thanks! I have the exact same problem. The IDLE window just never opens, and checking the process list shows that is was never even launched. So I can't make much use of Python 2.4 since I use IDLE as my IDE... -- Brian Beck Adventurer of the First Order -- http://mail.python.o

Re: The python2.4 IDLE can't be lanuched.

2004-12-06 Thread Brian Beck
Brian Beck wrote: I have the exact same problem. The IDLE window just never opens, and checking the process list shows that is was never even launched. So I can't make much use of Python 2.4 since I use IDLE as my IDE... I forgot to note that I am also using Windows XP SP2 and this happe

Re: The python2.4 IDLE can't be lanuched.

2004-12-06 Thread Brian Beck
o remember seeing that message but thought "no way" since the Windows firewall is pretty forgiving in my experience. But after a bit of tweaking and even disabling the firewall completely, the problem persists. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mai

Class Variable Inheritance

2004-12-08 Thread Brian Jones
erstand is why mastervar gets modified by each _seperate instance_ of classes that happen to extend the base class 'a'. Shouldn't mastervar be contained within the scope of the inheriting classes? Why is it being treated like a global variable and being modified by the other ins

Re: Python Docs. Hardcopy 2.4 Library Reference, interested?

2004-12-09 Thread Brian Gough
out. The amount of text in the library manual is huge (it requires two volumes), which makes it more costly. -- best regards, Brian Gough Network Theory Ltd, Publishing the Python Manuals --- http://www.network-theory.co.uk/python/ -- http://mail.python.org/mailman/listinfo/python-list

Re: mapping function to vars

2004-12-09 Thread Brian Quinlan
[EMAIL PROTECTED] wrote: I need to map a function to several variables. I'm trying to use map and lambda to do this. Here's my attempt... #!/usr/bin/env python from random import * [fee, fye, foe, fum] = map(lambda n: random(), range(4)) from random import random fee = random() fye = random() foe

Re: Python Docs. Hardcopy 2.4 Library Reference, interested?

2004-12-11 Thread Brian Gough
thon/language/ - language reference http://www.network-theory.co.uk/about.html - general company info -- best regards Brian Gough Network Theory Ltd, Publishing the Python Manuals --- http://www.network-theory.co.uk/python/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Python mascot proposal

2004-12-12 Thread Brian Beck
cwru.edu/python2.png If anyone can think of a way to break free of the reptile-oriented thought process but maintain clear, symbolic imagery, I'd love to see more suggestions or renditions! -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: from string to raw string

2004-12-13 Thread Brian Beck
;s a syntax to tell the Python interpreter which characters in your string are 'special' and has no effect on strings not input as literals directly within your code. Strings from files or any input besides the interactive Python shell will already be what you're looking for.

Keyword arguments - strange behaviour?

2004-12-21 Thread brian . bird
st method can only be determined if you know how many times it has already been called) Is this behaviour what you would (should?) intuitively expect? Thanks, Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Keyword arguments - strange behaviour?

2004-12-21 Thread brian . bird
Thanks, this makes perfect sense. The phrase which sums it up neatly is "Default parameter values are evaluated when the function definition is executed" However, is there a good reason why default parameters aren't evaluated as the function is called? (apart from efficiency and backwards compatib

Re: Keyword arguments - strange behaviour?

2004-12-21 Thread brian . bird
def function(arg=otherfunction(value)): return arg My expectation would have been that otherfunction(value) would be called if (and only if) the arg keyword parameter was missing from the function() call (ie. the optional value is evaluated the lazy way). Also, otherfunction would be called each a

Re: Keyword arguments - strange behaviour?

2004-12-23 Thread brian . bird
={}) How could I re-write this (especially if there are perhaps 20 optional parameters,any number of which may have mutable defaults) without writing 20 "if opt1 is None: opt1=[]" statements? Brian -- http://mail.python.org/mailman/listinfo/python-list

Re: Are tuple really immutable?

2004-12-27 Thread Brian Beck
bers, same ranking. Good analogy. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: argument type

2004-12-27 Thread Brian Beck
It's me wrote: How do I know if arg1 is a single type (like a number), or a list? isinstance is probably good enough for your needs. if isinstance(arg1, (list, tuple, dict)): print "arg1 is a container" else: print "arg1 is (probably) not a container" -- Brian Bec

Re: Why tuples use parentheses ()'s instead of something else like <>'s?

2004-12-29 Thread Brian Beck
t; and {}'s are clearly already used for dictionaries. -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with splitting

2005-04-01 Thread Brian Beck
ith an attrgetter, but apparently my understanding of that isn't perfect... it groups by the identify of the bound method instead of calling it... -- Brian Beck Adventurer of the First Order -- http://mail.python.org/mailman/listinfo/python-list

playing with pyGoogle - strange codec error

2005-04-04 Thread Brian Blazer
nt Everything works fine until I get to r.snippet. Here is the error: UnicodeEncodeError: 'ascii' codec can't encode character '\ua9' in position 119: ordinal not in range(128) Any help is appreciated. Thanks, Brian -- Nail a post to the Spalted Board. Fr

Re: playing with pyGoogle - strange codec error

2005-04-05 Thread Brian Blazer
On 2005-04-05 07:32:12 -0500, "Richard Brodie" <[EMAIL PROTECTED]> said: "Brian Blazer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] Everything works fine until I get to r.snippet. Here is the error: UnicodeEncodeError: 'ascii' codec can

Re: playing with pyGoogle - strange codec error

2005-04-05 Thread Brian Blazer
On 2005-04-04 10:06:23 -0500, Brian Blazer <[EMAIL PROTECTED]> said: You know, I am beginning to think that I MAY have stumbled on a bug here. At first I was thinking that this issue was related to the offending character being out of range for the Mac. Then I tried it on A MS machine

Re: playing with pyGoogle - strange codec error

2005-04-05 Thread Brian Blazer
On 2005-04-05 13:55:48 -0500, Erik Max Francis <[EMAIL PROTECTED]> said: Thank you, that worked. Brian -- Nail a post to the Spalted Board. Free WW'ing software and forums. Regular freebies! http://www.spaltedboard.com -- http://mail.python.org/mailman/listinfo/python-list

Python Equivalent to Java Interfaces?

2005-04-08 Thread Brian Kazian
I want to insure that all subclasses implement a certain method, but could not find anything that would do this for me. Is there anyway in Python to implement this check? Thanks! -- http://mail.python.org/mailman/listinfo/python-list

Re: Python's use in RAD

2005-04-15 Thread brian . peyton
Active State's Komodo IDE is very nice for python development. It includes integration with pdb (python's debugger). The pro edition also has a GUI designer, however I've never used it. The personal version for non commercial use can be had for $30 (and there's also a 30 day trial). They have w

pre-PEP: Simple Thunks

2005-04-15 Thread Brian Sabbey
Here is a first draft of a PEP for thunks. Please let me know what you think. If there is a positive response, I will create a real PEP. I made a patch that implements thunks as described here. It is available at: http://staff.washington.edu/sabbey/py_do Good background on thunks can be fo

pre-PEP: Suite-Based Keywords

2005-04-15 Thread Brian Sabbey
Here is a pre-PEP for what I call "suite-based keyword arguments". The mechanism described here is intended to act as a complement to thunks. Please let me know what you think. Suite-Based Keyword Arguments - Passing complicated arguments to functions is currently awk

Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Brian Sabbey
Shane Hathaway wrote: Kent Johnson wrote: Brian Sabbey wrote: Using suite-based keyword arguments, the code f(x = 1) is equivalent to f(): x = 1 ISTM the syntax is ambiguous. How do you interpret if f(): x = 1 ? Is a suite alllowed only when a block could not be introduced in the current

Re: pre-PEP: Suite-Based Keywords

2005-04-16 Thread Brian Sabbey
Reinhold Birkenfeld wrote: Brian Sabbey wrote: Here is a pre-PEP for what I call "suite-based keyword arguments". The mechanism described here is intended to act as a complement to thunks. Please let me know what you think. Suite-Based Keyword Arguments ---

<    1   2   3   4   5   6   7   8   9   10   >