Re: Encapsulation, inheritance and polymorphism

2012-07-19 Thread OKB (not okblacke)
cepting that thou then proceed to four. Tabs are right > out.""" > -- Georg Brandl Yes, and the Lord was Wrong. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."

Re: copy on write

2012-02-03 Thread OKB (not okblacke)
ork? It would work, it just wouldn't work in-place. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Question about circular imports

2012-02-26 Thread OKB (not okblacke)
Also, I'm too lazy to check right now, but I wouldn't be suprised if "mport formats.wavread as wavread" also works even in the circular case. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and

Re: Question about circular imports

2012-02-27 Thread OKB (not okblacke)
ying to think about how it ought to work with a importing c but then c and d importing each other makes my brain hurt. Refactoring the files so that common code is in a separate library imported by both is easier to understand, and has the nice side bonus that it works. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: why () is () and [] is [] work in other way?

2012-04-26 Thread OKB (not okblacke)
You might think it's not the best way to do it based on abstract conceptual frameworks for how programming languages "should" work, but it works just fine. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and l

Re: Python id() does not return an address [was Re: why () is () and [] is [] work in other way?]

2012-04-28 Thread OKB (not okblacke)
his is getting pretty absurd. By that logic you could say "With Python, you can end all life on earth! You just add a function to the language called nuclear_winter() that remotely accesses warhead launch sites in the US and Russia, enters the appropriate launch codes, and launches

Re: Why won't this decorator work?

2011-07-03 Thread OKB (not okblacke)
random expression you want -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone want to critique this program?

2011-07-03 Thread OKB (not okblacke)
I do, because I use an editor that intelligently indents wrapped text to the same indent level as the beginning of the line, instead of wrapping it all the way back to the margin. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Anyone want to critique this program?

2011-07-04 Thread OKB (not okblacke)
John Salerno wrote: > On Jul 3, 1:06 pm, "OKB (not okblacke)" > wrote: > >> > Yeah, I considered that, but I just hate the way it looks when the >> > line wraps around to the left margin. I wanted to line it all up >> > under the opening quotation

Re: None versus MISSING sentinel -- request for design feedback

2011-07-15 Thread OKB (not okblacke)
l, you irrevocably lose the ability to tell it apart from other uses of None. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 8 and extraneous whitespace

2011-07-27 Thread OKB (not okblacke)
ue for this general mindset when they say that "any good edit will let you set the tab width", etc. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 8 and extraneous whitespace

2011-07-29 Thread OKB (not okblacke)
Chris Angelico wrote: > On Thu, Jul 28, 2011 at 4:18 PM, OKB (not okblacke) >>        I think exactly the opposite.  The source file should re flect >> the semantic organization of the code, without extraneous concessions >> to visual display (like "lining things up

Re: Is it bad practise to write __all__ like that

2011-07-29 Thread OKB (not okblacke)
Thomas Rachel wrote: > class AllList(list): > """list which can be called in order to be used as a > __all__-adding > decorator""" Wow, this is a great idea. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path

Re: PEP 8 and extraneous whitespace

2011-07-30 Thread OKB (not okblacke)
Chris Angelico wrote: > On Sat, Jul 30, 2011 at 4:45 AM, OKB (not okblacke) > Suppose you want to have a lengthy piece of text embedded in your > source code, which you will then pass to a GUI widget for display. > You want the widget to handle word wrap, so you don't want inter

Relative import from script with same name as package

2011-08-13 Thread OKB (not okblacke)
name and change the code in thetest.py to match, it works fine. But I shouldn't have to do this. How can I get relative imports to work correctly when running a script whose filename is the same as that of the directory (and thus the package) in which it resides? -- --OKB (not ok

Re: Relative import from script with same name as package

2011-08-13 Thread OKB (not okblacke)
OKB (not okblacke) wrote: > But why? That __future__ import is supposed to make > absolute > imports the default, so why is "import thetest" importing > thetest.py instead of the package called thetest? The absolute > import should make it look in s

Re: Relative import from script with same name as package

2011-08-14 Thread OKB (not okblacke)
ackage. That error message is what you see when you try to *run* a > package member module which uses explicit relative imports. Let me > try to explain a bit further: Yes, such a thing was happening. (I described the fix in an answer to my own post.) You should read PEP 366

Re: Syntactic sugar for assignment statements: one value to multiple targets?

2011-08-17 Thread OKB (not okblacke)
exactly N copies of the same thing and assign them to explicit names. If I'm not making just one, it's usually because I'm making some sort of list or dict of them that will be accessed by index (not with names like "x", "y", and "z"), in which cas

Re: Understanding .pth in site-packages

2011-08-27 Thread OKB (not okblacke)
there is a general way to globally "shadow" a package that exists in site-packages. However, according to the docs the .pth files are added in alphabetical order, so if it is indeed easy_install.pth that is adding your egg, you could hack around it by making a file with an alphabeti

Re: Understanding .pth in site-packages

2011-08-27 Thread OKB (not okblacke)
re "jump the line" and go to the front, look at easy_install.pth, which seems to have some magic code at the end that moves its eggs ahead of site-packages in sys.path. I'm not sure how this works, though, and it seems like a risky proposition. -- --OKB (not okblacke) Brenda

Re: What do I need to know in order to write a web application in python?

2011-03-05 Thread OKB (not okblacke)
order to be able to do the same with >> python? Which python modules/python development environments do I >> need to use? > > You might want to look at: http://visualpython.org/ Also www.dabodev.com -- --OKB (not okblacke) Brendan Barnwell "Do not follow where th

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread OKB (not okblacke)
Robert wrote: > Is there a push to one toolkit or the other? I use Dabo, which wraps wxPython. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://ma

Re: What do you use with Python for GUI programming and why?

2011-03-11 Thread OKB (not okblacke)
Octavian Rasnita wrote: > From: "OKB (not okblacke)" >> Robert wrote: >> >>> Is there a push to one toolkit or the other? >> >>I use Dabo, which wraps wxPython. >> >> -- > > > What's the advantage of using Dabo ins

Re: Guido rethinking removal of cmp from sort method

2011-03-26 Thread OKB (not okblacke)
d if there > any others. It seems not. That is one use case for preferring cmp. Another use case is "I can easily think of how to write the cmp function and not the key function and I don't care about either speed or memory usage". There's more to practicality

Re: [Q] ipython: Multiple commands on the same line and newlines

2011-04-16 Thread OKB (not okblacke)
a look at DreamPie ( http://dreampie.sourceforge.net/ ), which provides the second option you indicate (and thus makesthe first unnecessary). I've found it quite convenient for interactive use. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: skipping one unittest assertion?

2011-05-01 Thread OKB (not okblacke)
n > production code that hasn't been written yet. I could factor that > out into its own test methods and @skip that, but it would be > cleaner to be able to mark the particular assertion. > > (using python 2.6, but importing unittest2 from 2.7) Can't you ju

Python drawing library?

2011-05-14 Thread OKB (not okblacke)
paint program, and let me get info about the drawing as its made (get color at mouse location, etc.). I'd prefer a wxPython solution, although any Python solution would be better than none. Thanks, -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead.

Re: I don't understand generator.send()

2011-05-14 Thread OKB (not okblacke)
use of the sent values. You can't just push values into any old generator. For it to do anything, you need to use assign the result of the yield to something within your generator and make use of it. See http://docs.python.org/whatsnew/2.5.html#pep-342-new-generator-features for an ex

Re: float("nan") in set or as key

2011-06-01 Thread OKB (not okblacke)
ct is a "float" rather than some other numeric type? I'm aware that there are answers to this having to do with standardization and efficiency. But I do sometimes wish that the "default" type for non- integers (as created through Python expressions) was something more

Re: about sort and dictionary

2005-11-22 Thread OKB (not okblacke)
> > 3 > 2 > 1 > 3 > 2 > 1 > > make a lot more sense ? Yes. The unintuitive thing is that the list is sorted in place at all. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: math.nroot [was Re: A brief question.]

2005-07-04 Thread OKB (not okblacke)
aluates to 1, > not -1. This isn't true. The "unary minus operator" is just a shorthand for multiplication by -1. As such, it has the same operator precedence as multiplication. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go,

all() is slow?

2011-11-07 Thread OKB (not okblacke)
>> timeit.timeit('all(a <= 100 for a in x)', 'gc.enable(); from __main__ import x', number=10) 5: 4.6433557896324942 What is the point of the all() function being a builtin if it's slower than writing a function to do the check myself? -

Re: all() is slow?

2011-11-10 Thread OKB (not okblacke)
John Nagle wrote: > On 11/7/2011 1:00 PM, OKB (not okblacke) wrote: >> I noticed this (Python 2.6.5 on Windows XP): > > CPython is slow. It's a naive interpreter. There's > almost no optimization during compilation. Try PyPy > or Shed Skin.

Re: all() is slow?

2011-11-10 Thread OKB (not okblacke)
ot; as the name of a namedtuple field. Yes, you can do "getattr(obj, '--')" if you want, but it's quite reasonable for namedtuple to refrain from catering to that sort of perverse usage. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path ma

Re: property decorator and inheritance

2011-11-10 Thread OKB (not okblacke)
of properties is that outside functions accessing them don't "know" that a getter function is called behind the scenes. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --

Re: (don't bash me too hard) Python interpreter in JavaScript

2011-11-20 Thread OKB (not okblacke)
t used numpy or something? Is that feasible? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Verbose and flexible args and kwargs syntax

2011-12-12 Thread OKB (not okblacke)
Steven D'Aprano wrote: > And you can blame C for the use of % instead of mod or modulo. Anytime you can blame C for something, you can also blame a bunch of other languages for foolishly perpetuating the inanities of C. -- --OKB (not okblacke) Brendan Barnwell "Do not fol

Re: predicting function calls?

2005-12-28 Thread OKB (not okblacke)
ue I'm about to return will > get called as a function (i.e., the name is followed by an open > paren). What do you do if the person does: x = handle.someOperation x(arg1, arg2) -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead,

matplotlib not plotting dates

2006-08-08 Thread OKB (not okblacke)
he matplotlib example scripts (e.g., date_demo1.py). I'm running it on Windows XP, Python 2.4, and my matplotlibrc file just has the default settings (TkAgg backend). -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no

Re: trouble using "\" as a string

2006-08-19 Thread OKB (not okblacke)
at the interactive prompt it shows '\\'. But try len(tempname) and see if it's 1. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: operator overloading + - / * = etc...

2006-10-12 Thread OKB (not okblacke)
uld like to see more control over the name-binding operation, and exposing the namespace as an object sounds like an interesting way to do this. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail.&quo

Re: Unpacking sequences and keywords in one function call

2006-11-13 Thread OKB (not okblacke)
bout this yesterday. Is there a reason you can only unpack a sequence at the END of the positional argument list? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http:

Re: Unpacking sequences and keywords in one function call

2006-11-14 Thread OKB (not okblacke)
Dennis Lee Bieber wrote: > On Tue, 14 Nov 2006 05:45:57 GMT, "OKB (not okblacke)" > <[EMAIL PROTECTED]> declaimed the following in > comp.lang.python: > >> >> I was just wondering about this yesterday. Is there a >> reason you &

Re: language design question

2006-07-09 Thread OKB (not okblacke)
Terry Reedy wrote: > Consider >>>> map(len, ('abc', (1,2,3), [1,2], {1:2})) > [3, 3, 2, 1] > > Now try to rewrite this using methods (member functions). [a.len() for a in ('abc', (1,2,3), [1,2], {1:2})] -- --OKB (not okblacke) Brendan Barnwell

Re: Looking for the Perfect Editor

2006-09-14 Thread OKB (not okblacke)
arates how the text is DISPLAYED from how it's SAVED. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: does anybody earn a living programming in python?

2006-09-26 Thread OKB (not okblacke)
uppose this may be considered insane, but, well you said it best yourself: > char **x = > (char**)malloc(...)... *x++ = (char*)malloc(...) ... free()... > free()... (segmentation fault)... bus error... gdb... blah blah, led > to thoughts such as, "i have better things to do w

Re: Top and Bottom Values [PEP: 326]

2006-09-27 Thread OKB (not okblacke)
Antoon Pardon wrote: > To begin with this already fails: > >>>> for i in xrange(Top): > ... print i What do you expect this to do? Loop forever? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is

Re: Inheritance from builtin list and override of methods.

2006-11-27 Thread OKB (not okblacke)
is is something that I think needs to change. All this talk about new-style classes and class-type unification is empty words if you can't override anything on any type without having to know whether it's written in C or Python. -- --OKB (not okblacke) Brendan Barnwell "Do not

Re: Inheritance from builtin list and override of methods.

2006-11-27 Thread OKB (not okblacke)
Carsten Haese wrote: > You can change the behavior of a list's sort method by overriding > sort. You can't change the behavior of sort by overriding > __getitem__ and __setitem__, because sort does not call __getitem__ > or __setitem__. Why doesn't it? -- -

Re: Why not just show the out-of-range index?

2006-12-04 Thread OKB (not okblacke)
e, but I am curious whether it would be possible for something like this: "1" + "2" + "3" + "4" + 5 + "6" To point to the actual addition that raises the exception (somewhat like it does for a syntax error), instead of just saying "ther

Re: Why not just show the out-of-range index?

2006-12-04 Thread OKB (not okblacke)
be holding the same incorrect value. I only want to look at the one that is ACTUALLY holding the incorrect value. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- h

Re: Why not just show the out-of-range index?

2006-12-06 Thread OKB (not okblacke)
oes not even tell me the type of the offending value, just that it is unsubscriptable. So my conclusion from this is: is there a reason that every error message of the form "expected foo" or "this object cannot be frotzed" cannot be changed to something like "ex

Re: Why not just show the out-of-range index?

2006-12-07 Thread OKB (not okblacke)
me to post this thoughtful and civil reply not once but six times. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: textwrap.dedent replaces tabs?

2006-12-29 Thread OKB (not okblacke)
Frederic Rentsch wrote: > (You dedent common leading tabs, except if preceded by common leading > spaces (?)). There cannot be common leading tabs if they are preceded by anything. If they were preceded by something, they wouldn't be "leading". -- --OKB (not okbla

Re: Python Documentation (should be better?)

2005-05-13 Thread OKB (not okblacke)
opriately. (As it is, it only lists them to two levels deep.) This would also be handy in that if I knew I wanted to go to Mutable Sequence Types, I could click on that directly from the index instead of having to click through Sequence Types first. -- --OKB (not okblacke) Brendan Barnwell

Re: Proposal: s1.intersects(s2)

2007-07-05 Thread OKB (not okblacke)
." A simple Google search will also turn up numerous uses of the phrase "non-intersecting sets", which would seem to be parallel (i.e., people are not bending over backwards to say "disjoint sets" or "sets with empty intersection"). -- --OKB (not okblacke

Re: In search of python idiom for accessing arbitrary fields at run time

2007-07-08 Thread OKB (not okblacke)
[...] > > This seems to do what I expect it to do. I'm wondering if that's the > preferred or standard way to do this in python. I wasn't sure how to > tease the answer to this question out of Google. I believe you are looking for the getattr function. -- --O

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-27 Thread OKB (not okblacke)
ons. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Is PEP-8 a Code or More of a Guideline?

2007-05-27 Thread OKB (not okblacke)
Carsten Haese wrote: > On Sun, 2007-05-27 at 07:30 +0000, OKB (not okblacke) wrote: >> Underscores are harder to type than any alphanumeric >> character. > > This is a discussion about underscores versus capital letters > denoting the word boundaries i

Re: Augmented assignment (was Re: Something in the function tutorial confused me.)

2007-08-11 Thread OKB (not okblacke)
parallel to unaugmented x = x + 1. On initial reading my tendency is to read the end of the sentence quoted above, see a paragraph break and apparently explanatory material, and go "oh, okay, I now have the full specification of this syntax" when in fact I don't.) -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Python is overtaking Perl

2007-09-04 Thread OKB (not okblacke)
the difference in favor of Python comes > from. No, it's the other way around. The big difference in India is in favor of Perl. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: newbie: self.member syntax seems /really/ annoying

2007-09-13 Thread OKB (not okblacke)
* s.boo() > > > Y do u thnk bng cncis is lwys a gd thng? No, but the point being made is that it would be better IN THIS CASE. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail.

Re: tuples, index method, Python's design

2007-04-09 Thread OKB (not okblacke)
rse such operations might be useful, but > algorithms that need an operation like that would self-document > their design more clearly by using a list instead of a tuple. This is a reasonable argument, but all such arguments miss what I think is an important use case for tuples: y

Re: super() doesn't get superclass

2007-09-20 Thread OKB (not okblacke)
sn't true. It should probably say something like "return the next element after "type" in the MRO of "element-or-type". -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail."

Re: Sets in Python

2007-09-20 Thread OKB (not okblacke)
Steven D'Aprano wrote: > But of course you can't look up the dict by value, only by > identity. But that's what you wanted. Actually, if I understand the OP's examples right, he wants to look up only by value, not by identity. -- --OKB (not okblacke) Brend

Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
a single backslash followed by the word "universe"? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Unicode raw string containing \u

2007-10-28 Thread OKB (not okblacke)
d) 9 word[0] u'\\' word[1] u'u' >>>> print word \universe word u'\\universe' That doesn't answer my question, since I asked for a unicode RAW string literal. Is this not possible? (I was able to get what I want using ur"\u005Cuniverse"

Variable-width lookbehind

2007-11-17 Thread OKB (not okblacke)
and http://dev.perl.org/perl6/rfc/72.html ). -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Variable-width lookbehind

2007-11-17 Thread OKB (not okblacke)
Paul Rubin wrote: > "OKB (not okblacke)" <[EMAIL PROTECTED]> writes: >> For years now Python has not supported variable-length >> lookbehinds. > > I'm not sure what that is and the perl links you gave don't work, > but it

Re: Variable-width lookbehind

2007-11-19 Thread OKB (not okblacke)
Gary Herron wrote: > OKB (not okblacke) wrote: >> Paul Rubin wrote: >> >> >>> "OKB (not okblacke)" <[EMAIL PROTECTED]> writes: >>> >>>> For years now Python has not supported variable-length >>>>

Re: Variable-width lookbehind

2007-11-19 Thread OKB (not okblacke)
Tim Roberts wrote: > "OKB (not okblacke)" <[EMAIL PROTECTED]> wrote: >> >> For years now Python has not supported variable-length >> lookbehinds. >>I'm just curious whether there are any plans to change this in >>Python 3.0,

Re: Updated PEP 359: The make statement

2006-04-20 Thread OKB (not okblacke)
Steven Bethard wrote: > Guido has pronounced on this PEP: > http://mail.python.org/pipermail/python-3000/2006-April/000936.h > tml > Consider it dead. =) This is the most frustrating pronouncement ever. -- --OKB (not okblacke) Brendan Barnwell "Do not follow w

Re: multiline comments

2006-04-20 Thread OKB (not okblacke)
ty tools to manage their code. What if I'm just putting together a little script to do something and I don't want to mess with a revision control system? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, an

Re: Embedding a literal "\u" in a unicode raw string.

2008-02-25 Thread OKB (not okblacke)
commands). One possibility is to separate out just the bit that has the \u, and use string juxtaposition to attach it to the others: s = ur"añado " u"$\\uparrow$" It's not ideal, but I think it's easier to read than your solution #2. -- --OKB (not ok

NumPy chararray and whitespace

2008-06-18 Thread OKB (not okblacke)
ts values. I am really, really, hoping this is not a hard-coded, unalterable behavior. Is there a way to get NumPy chararray to include the characters I tell it to, without modificiation? Thanks, -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go,

Re: function call - default value & collecting arguments

2008-04-02 Thread OKB (not okblacke)
there is at least one argument, and print that first one, and make it zero if it's not supplied, why are you using the *a syntax? You're clearly treating that first argument distinctly, since you want to apply a default value to it but not to any others. Just do this: def f(

Relative imports and "import X as Y"

2008-08-30 Thread OKB (not okblacke)
things like "import ..relative.importing.path as prettyname"? If not, why not? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Relative imports and "import X as Y"

2008-08-30 Thread OKB (not okblacke)
Thanks for the advice, but I'd really rather not deal with installing the entire thing alongside my existing version, possibly causing conflicts in who knows what ways. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no pat

Re: Relative imports and "import X as Y"

2008-09-02 Thread OKB (not okblacke)
Gabriel Genellina wrote: > En Sun, 31 Aug 2008 07:27:12 -0300, Wojtek Walczak > <[EMAIL PROTECTED]> escribió: > >> On Sun, 31 Aug 2008 06:40:35 GMT, OKB (not okblacke) wrote: >> >>>> Download the latest beta for your system and give it a try. >>

Re: PyGUI as a standard GUI API for Python?

2008-09-03 Thread OKB (not okblacke)
Michael Palmer wrote: > As anyone knows, the state of Python GUI programming is a little > fractured at this time, with many toolkits, wrappers and meta-wrappers > dead and alive, with or without documentation. How about Dabo? http://www.dabodev.com/ -- --OKB (not okblacke

Re: How to get the filename in the right case ?

2008-09-25 Thread OKB (not okblacke)
nux will be fine, right? It's only a problem if you somehow try to use a filename created by windows- pdb to open a file (the same file, somehow) on linux. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: PEP 359: The "make" Statement

2006-04-13 Thread OKB (not okblacke)
have sometimes wanted this ability for classes, so that class definitions could map assignments onto class attributes in some way besides blindly stuffing into a dict. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no pat

Re: set using alternative hash function?

2009-10-16 Thread OKB (not okblacke)
lar attribute access? This seems to do exactly what you want. d = {} x.name = 'foo' y.name = 'foo' d.setdefault(x.name, x) d.setdefault(y.name, y) If you really want the syntactic sugar of [], you could write a simple class that wraps a dict and maps MyDict[x] to di

Re: IDLE python shell freezes after running show() of matplotlib

2009-10-28 Thread OKB (not okblacke)
't work. I have to restart IDLE to use it > again. > > My system is Ubuntu Linux 9.04. I used apt-get to install IDLE. I believe this is the intended behavior. Look in matplotlib documentation on the difference between interactive and non-interactive modes. -- --OKB (

Re: conditional __init__

2009-11-02 Thread OKB (not okblacke)
I imagine it's possible to do fiendish things and try to choose the superclass inheritance order at runtime, but you should be wary of this. In your example, why don't you just have K override printme and dispatch to A or B depending on "value"? -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Comparison with False - something I don't understand

2010-12-08 Thread OKB (not okblacke)
now that, in a particular context, you want toy(x, 0) to result in 42 instead of ZeroDivisionError, why not just define safeToy(x, y): try: retVal = toy(x, y) except ZeroDivisionError: retVal = 42 return retVal . . . and then call safeToy in

Krippendorff's alpha

2011-01-21 Thread OKB (not okblacke)
Does anyone know of a Python implementation of calculating Krippendorff's alpha? ( http://en.wikipedia.org/wiki/Krippendorff%27s_Alpha ) Thanks, -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and lea

Re: Krippendorff's alpha

2011-01-21 Thread OKB (not okblacke)
Steven D'Aprano wrote: > On Sat, 22 Jan 2011 01:48:01 +0000, OKB (not okblacke) wrote: > >> Does anyone know of a Python implementation of calculating >> Krippendorff's alpha? ( >> http://en.wikipedia.org/wiki/Krippendorff%27s_Alpha ) > > Google is your

Re: Use the Source Luke

2011-02-01 Thread OKB (not okblacke)
e better for Python; likewise, the more that people have to mention the existence of C in a Python context, the worse for Python. This may be a somewhat extreme viewpoint, but that's my position. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, ins

Re: Use the Source Luke

2011-02-04 Thread OKB (not okblacke)
rusi wrote: > On Feb 2, 12:32 am, "OKB (not okblacke)" >>         I think, in general, the less anyone needs to know C even >> exists, the better for Python; likewise, the more that people have >> to mention the existence of C in a Python context, the worse for >

Re: Why Python3

2010-06-28 Thread OKB (not okblacke)
7;t, because that library doesn't exist for Python 3. Some things are part of the standard lib, some aren't. I want to be able to start a project and be able to find what I need, whether that's part of the standard lib or not. -- --OKB (not okblacke) Brendan Barnwell "D

Re: New implementation of re module

2009-07-27 Thread OKB (not okblacke)
MRAB wrote: > http://bugs.python.org/issue2636#msg90954 Variable-length lookbehind! My hero! -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://ma

Re: Is behavior of += intentional for int?

2009-08-30 Thread OKB (not okblacke)
I would say that in Python, objects do not have values. Objects are values. -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: class initialization problem

2009-09-17 Thread OKB (not okblacke)
its own nested instance, and so on to infinity. Perhaps you want to cut off the recursion at the first step, so that the nested instance itself does not have a nested instance. If so, add another parameter to __init__ that flags whether you are creating a "top-level"

Playing sounds at time indexes

2010-09-22 Thread OKB (not okblacke)
.25 seconds to 11.73 seconds." Is there a library that makes this easy in Python? Thanks, -- --OKB (not okblacke) Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown -- http://mail.python.org/mailman/listinfo/python-list

Re: Playing sounds at time indexes

2010-09-24 Thread OKB (not okblacke)
Thomas Jollans wrote: > On Wednesday 22 September 2010, it occurred to OKB (not okblacke) > to exclaim: >> I'm looking for an audio library for Python. I googled >> and found a >> few, but none of them seem to have a simple way to play a &g