/* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
(reprfunc)file_repr,/* tp_repr */
0, /* tp_as_number */
[...]
Thanks,
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> Benjamin Rutt wrote:
>
>> If I did the following in an infinite loop, would the host system/user
>> account soon run out of file descriptors? (I'm thinking no, since I'd
>> imagine that a file object
7;s called 'keep-alive'.
> And even if it works - what is the problem with connections being created?
Performance, network load...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
t;
> For example you import a module, programatically edit it, then have the
> file reload the module?
>
> Does anyone have any ideas about this?
> Steve
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Roman Suzi wrote:
I wish lambdas will not be deprecated in Python but the key to that is
dropping the keyword (lambda). If anybody could think of a better syntax for
lambdas _with_ arguments, we could develop PEP 312 further.
Well, my vote is still with Ruby-style codeblock syntax, but as a
compro
Kevin Smith wrote:
I have many cases in my code where I use a property for calculating a
value on-demand. Quite a few of these only need to be called once.
After that the value is always the same. In these properties, I set a
variable in the instance as a cached value and return that value on
Will Stuyvesant wrote:
. def delay(exp): return lambda: exp
If you look at the definition of "delay" in SICP, you'll notice that
it's defined as "syntax sugar", in other words, a macro. Since Python
does not have macros, you'll have to just use "lambda", because by
defining "delay" as a function
Paul Rubin wrote:
Tim Peters <[EMAIL PROTECTED]> writes:
But at that time, Python didn't have lexical scoping, and it wasn't
clear that it ever would. So what's the bigger wart? Making
listcomps exactly equivalent to an easily-explained Python for-loop
nest, or introducing a notion of lexical sco
Davor wrote:
Is it possible to write purely procedural code in Python, or the OO
constructs in both language and supporting libraries have got so
embedded that it's impossible to avoid them? Also, is anyone aware of
any scripting language that could be considered as "Python minus OO
stuff"? (As you
like Python is determining at that point that
"x" is a class variable, and refuses to search any further.
At the top-level, it works as expected:
>>> x = 5
>>> class C(object):
... x = x
...
>>> C.x
5
Any implementation gurus have some insight into w
cally into an bigint. The other way round, turning an bigint
into long can be realized by defining __long__.
Can someone help me please?
Benjamin
--
http://mail.python.org/mailman/listinfo/python-list
Alex Martelli wrote:
Benjamin Schmeling <[EMAIL PROTECTED]> wrote:
...
I don't know how to achieve implicit conversion at this point,
turning an
long automatically into an bigint. The other way round, turning an
bigint
into long can be realized by defining __long__.
Perhap
verifiable.
--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."
--
http://mail.python.org/mailman/listinfo/python-list
Thanks, Nick and Alex, for the nice, detailed explanations. My understanding
of Python bytecode is not deep enough to comment at this time. ;)
--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."
cgitb mailcap smtplib
[...]
I want to do the same (get all such modules in a python list); how can
I do so? Or where is the code for the REPL for help() itself so I can
find out myself?
This is to build a code introspection tool BTW. Thanks,
--
Benjamin Rut
Guido gave a good, long interview, available at IT Conversations, as was
recently announced by Dr. Dobb's Python-URL! The audio clips are available
here:
http://www.itconversations.com/shows/detail545.html
http://www.itconversations.com/shows/detail559.html
I'd like to comment on a few parts of
Stephen Kellett wrote:
> In message <[EMAIL PROTECTED]>, Simon
> Brunning <[EMAIL PROTECTED]> writes
>
>> Eclipse's refactorings are a great boon, I find. Refectoring is never
>> *fully* automatic, of course, but the ability to, for example, select
>> a chunk of code and have it extracted into a
Sakesun Roykiattisak wrote:
>
>> What's being ignored is that type information is useful for other things
>> than compile type checking. The major case in point is the way IDEs
>> such as IntelliJ and Eclipse use type information to do refactoring, code
>> completion and eventually numerous other
BORT wrote:
> I am toying with the idea of teaching my ten year old a little about
> programming. I started my search with something like "best FREE
> programming language for kids." After MUCH clicking and high-level
> scanning, I am looking at Python and Forth. Both have advocates that
> say e
Steven Bethard wrote:
> Guido also suggests that the explicit:
>
> class C(object):
> pass
>
> is "much preferred"[2] over:
>
> __metaclass__ = type
>
> class C:
> pass
Really? I have been toying with the idea of using the __metaclass__
trick, since it results in c
]
> Traceback (most recent call last):
> File "", line 1, in ?
> NameError: name 'x' is not defined
Because the right hand side ('[1,2,x]') is evaluated *before* the value is
bound to the name 'x' - and at this point there is obviously no name 'x'
defined.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Brett Hoerner wrote:
> Is there a different shell I can use (other than cmd.com) to run Python
> in, where I can full-screen the window (if I pleased), etc? As it is,
> things that would run far off the right have to be word wrapped after
> very few characters.
I have a pretty exotic setup but I
Better
use the generator syntax (requires python 2.4):
minDist, closestPlace = min(((place.pos-pos).len(), place)
for place in galaxy.places.itervalues())
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
nterpreted by the parser, e.g. r"\x" == "\\x". Using
r"" when working with the re module is not required but pretty useful,
because re has it's own rules for backslash handling).
For more details see the docs for re.sub():
http://docs.python.org/lib/node114.html
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
o learn a new programming language for every
program I'd like to apply a minor fix/customization to: not a good idea.
Probably not just for the casual hacker like me, but also for the
maintainance phase of a project, when the former lead gurus lost interest
and/or employment.
--
Benjami
27;somefunction', )]
trying istraceback: []
I was trying to use inspect.getmembers(foo, ) with an
appropriate predicate ("is" function). it looks like I am able to
discover that 'someclass' is a class, and that 'somefunction' is a
function (and also a routine, apparently). However, I cannot seem to
discover that 'someglobal' is a global. How to do so? Thanks,
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
ting what in the code what is for the GUI, what is for the Web
server, and what does the introspection. I have actually borrowed the
ModuleScanner class already, to build the list of modules. It is just
inspecting those modules further where I'm having trouble.
thanks,
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
Joseph Garvin wrote:
> Robert Kern wrote:
>
>> Not everyone is reading this list in a conveniently threaded form
>>
>>
> Why not? Just about every modern newsgroup reader and e-mail app has a
> threaded view option.
My newsreader supports threading, but the first message I see in this
thread
Ramza Brown wrote:
> This is an update from Brian Zimmer of the Jython group, new release:
Great news!
> - new installer
How do I use it?
Thanks,
Dave
--
http://mail.python.org/mailman/listinfo/python-list
Dave Benjamin wrote:
> Ramza Brown wrote:
>
>> This is an update from Brian Zimmer of the Jython group, new release:
>
> Great news!
>
>> - new installer
>
> How do I use it?
I figured it out. You might want to document this somewhere. ;)
java
Ramza Brown wrote:
>>
>> I figured it out. You might want to document this somewhere. ;)
>> java -cp jython_Release_2_2alpha1.jar
>> org.python.util.install.Installation
>
> Did you try double clicking on the jar. That is what most do or at
> least the last package supported that.
Yeah. It ope
t_changed(key, value)
self.d[key] = value
def __getitem(self, key):
return self.d[key]
....
And in A.__init__
self.d = WrappedDict(self, {})
You may also subclass WrappedDict from dict...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
"That's my house" == 'That\'s my house'
"You say: \"Hello\"" == 'You say: "Hello"'
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
reate a setup.py
script for distribution. IIRC setup.py will recognize the shebang of your
scripts and replace it with the proper path to python of the target system
during installation.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
ject (that you got from an open() call)
as the first parameter. What you need is a string with the path to the
file.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
).
But you should be aware of the fact that (if you send mail from a dialup
machine without going through a relay server) your mails will quickly be
marked as spam - I hope you do not intend to send spam...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Cliff Wells wrote:
> On Sun, 2005-07-31 at 13:14 +0200, Benjamin Niemann wrote:
>
>> But you should be aware of the fact that (if you send mail from a dialup
>> machine without going through a relay server) your mails will quickly be
>> marked as spam - I hope you do
Cliff Wells wrote:
> On Mon, 2005-08-01 at 12:28 +0200, Benjamin Niemann wrote:
>> Cliff Wells wrote:
>
>[snip]
>
>> > By using a local SMTP server to proxy, your app can
>> > queue up a large amount of mail in a much shorter period. It won't
>>
tmllib and see, which parser is more forgiving.
You might pipe the document through an external tool like HTML Tidy
<http://www.w3.org/People/Raggett/tidy/> before you feed it into
HTMLParser.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
use unittest (because this was the API the textbook was using
that introduced me to this topic) and I also had the problem of heavy setup
costs. I deal with it by using a script around my testsuite (instead of
calling just unittest.main()) that does the setup/teardown of the
environment.
--
Benjami
Christoph Zwerschke wrote:
> Benjamin Niemann wrote:
>> Some (many?) people don't like the unittest module, because it is not
>> very pythonic - nothing to wonder as it has its root in the Java world.
>> That's probably one of the reasons why there are other
Michael Hoffman wrote:
> Benjamin Niemann wrote:
>> Christoph Zwerschke wrote:
>>
>>
>>>Benjamin Niemann wrote:
>>>
>>>>Some (many?) people don't like the unittest module, because it is not
>>>>very pythonic - nothing to won
ne of my favourite
programming adventures, I do not have such a personal relationship with my
classes ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
into
much smaller steps, each step finalized with a 'all tests passed - your
code works *exactly* as specified' (if you treat the testsuite as the
formal specification, which I do), then you are tempted to celebrate all
these small successes with a small reward. Baaad thing, if you smoke like I
do...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
wn() method
try:
m = measurement()
try:
m.setup()
m.run()
finally:
m.tearDown()
except KeyboardInterrupt:
# user pressed ctrl-C
print "***BREAK"
sys.exit(1)
except:
# you should at least log the exception for later debugging
traceback.print_exc()
and remove the calls to setup() and run() from the constructor.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] wrote:
> Hello Benjamin,
>
> What would happen if an exception was thrown in the middle of setup()?
> tearDown could not handle this case without having a list of the
> objects already constructed (Or I would have to rely on the automatic
> call to __del__,
Luis M. Gonzalez wrote:
> This is great!
> It's absolutely useless, like a real therapist, but it's free!
Never heard of Eliza? Even Emacs has it built in (Menu Help -> Emacs
Psychiatrist).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
htt
this module does not have that method.. i'm left no choice but to edit
> the site.py file manually to change "ascii" to "utf-8", but i won't be
> able to do that on the client computers so..
> Anyways i don't know if it would help my script at all..
There was just recently a discussing on setdefaultencoding() on various
pythonistic blogs, e.g.
http://blog.ianbicking.org/python-unicode-doesnt-really-suck.html
>
> any help will be greatly appreciated
> thx
>
> Marc
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
ag that is polled by the main
thread.
You could also try to send a signal to yourself, but I'm not sure what will
happen then...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
ses a format that is automatically recognized by the
emacs editor. If you are using another editor, you'll have to search its
menus for the proper way to save files as utf-8.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
phores etc.), there should not be any greater
problems.
The function will be executed in the thread that is called it of course (and
not in the thread that sent the reference to it).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
write '\\', if you need a backslash
in the string, e.g. r'\w+' == '\\w+'.
Useful for regular expression (because the re module parses the '\X'
sequences itself) or Windows pathes (e.g. r'C:\newfile.txt').
And you should append a '$' to the re
Qopit wrote:
> [snip]
>
> My questions are:
> - Am I missing something with my tester example?
> - Are there other code-checking options other than PyChecker?
Try pylint
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/m
uperset of
static code checking - all type bugs are found be the testsuite even in the
absence if static type checking.
So you won't loose anything, if you drop static typing.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
er is slw, you'll still have a significant
delay... To avoid this, you would need a http client based on select() that
allows you to check shutdownEvent.isset() at certain intervals - instead of
urlopen which just blocks.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
tributes from the JS
documentation to COM calls (the JS members start with lowercase - e.g.
'properties' -, while COM need uppercase - 'Properties').
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
ges are uncompressed anyway, you could have a look at the netpbm
suite and its fileformat (which is pretty simple, but uncompressed and
would bloat JPEGs to a multiple of the original filesize) which supports
'image sequences'. Perhaps a DivX encoder could even support this
fileformat d
rogram would really suprising.
Python suprises me often, but in different ways ;)
Perhaps you could try to use sys.stdout.write() directly, avoiding the
overhead of 'print'. Perhaps there are differences between the (default)
output buffering settings of perl and python.
-
ge of this) - if
you use anything else, then you'll have to declare it.
This will be important, if you use unicode strings:
u"stränge characters"
Python must know the encoding of the file in order to decode the string
literal into an unicode string.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
hree lines above? (These would trigger
a SyntaxError because of the typo...)
You should provide a more complete example, so we can tell you where the
problem is. Try to build a minimal file that reproduces the problem. Often
you will find the line causing the error yourself - and the fix might be
consecutive positions.
If that's the cause, then here's another reason to use long, descriptive
names instead of C64-BASIC style a, b, c, i, j... - with long names the
chances of hash collisions are pretty low.
Or everyone will start optimizing their programs by using long, *random*
names
;)
(Your prints above are mostly equivalent, but do not output the correct \r\n
as line terminator - at least on UNIX style systems. Most webservers
tolarate this, if it's coming from a CGI - but doing it right and not
relying on a certain server behaviour is not bad anyway ;)
Then check the PIL docs to find out, how to output the image to sys.stdout
(instead of writing to a file).
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Tompa wrote:
> Benjamin Niemann odahoda.de> writes:
>> You are almost there.
> I don't feel so...
>
>> Your create_image.py does not return anything to the
>> browser yet.
> Yes, I am aware of that but I do not what to return.
>
>> First return pr
by month name, I suppose I could just substitute the month name using
> a translation table for English to Dutch month names.
Have you tested it with the proper locale setting and strptime(dateString,
"%c")? I have not ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odah
finite statement on whether threads
> are safe from unwanted garbage collection, that'd be really great.
> Thanks in advance for any helpful replies!
The threading module does already take care of keeping references to all
running threads, so there's no need to do it yourself and y
to a email message?
I can't help you with Thunderbird. In the worst case, you'll have to encrypt
your command file manually and attach the encrypted version to your mail.
KMail does have checkboxes for encrypt/sign every attachment separately...
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Sion Arrowsmith wrote:
> In article <[EMAIL PROTECTED]>, Benjamin Niemann <[EMAIL PROTECTED]>
> wrote:
>>[EMAIL PROTECTED] wrote:
>>> However, in my current project I'm creating a bunch of threads which
>>> are supposed to run until they've co
se
> except ValueError:
> pass
>
> # throw expception if field is required and is empty
> if(product[k] == '' and fieldIsRequired):
> raise GMError(k + ' is required')
if product[k] == '' and k in fieldIsRequired:
raise GMError(k + ' is re
"/tmp/bar"?
Thanks,
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
me you save a new file), the existing version is renamed with the ~
suffix.
After some time, you will learn to simply ignore these files ;)
Many file managers have already learnt this lesson and have options to hide
such backup files.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Terry Hancock wrote:
> On Monday 05 September 2005 08:10 am, Laszlo Zsolt Nagy wrote:
>
>>The problem is that now I have so many modules that the shell (cmd.exe)
>>cannot interpret this as a one command.
>
> In POSIX systems, the shell expands wildcards into multiple files on
> the command line
[EMAIL PROTECTED] wrote:
> Let's say I define a list of pairs as follows:
>
>>>l = [('d', 3), ('a', 2), ('b', 1)]
>
>
> Can anyone explain why this does not work?
>
>>>h = {}.update(l)
>
>
> and instead I have to go:
>
>>>h = {}
>>>h.update(l)
>
> to initialize a dictionary with the given l
Mike Meyer wrote:
> Dave Benjamin <[EMAIL PROTECTED]> writes:
>
>>Python is actually quite consistent in this regard: methods that
>>modify an object in-place return None;
>
> Um, no. list.pop comes to mind as an immediate counterexample. It may
> be th
esult = 1
elif num>50:
result = 2
fooResult.put(result)
t = thread.start_new_thread(foo,(12,))
# do other stuff, foo is running in background
r = fooResult.get() # guaranteed to block until result is available
print r
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
For a class modeling the block puzzle I use nested lists as arrays.
Within this class there is a method for swaping elements. I have lots
of trouble with that method but can't figure it out. It has probably to
do with my unuseful approach to nested lists, but I don't want to write
the code
Will McGugan wrote:
I'm accumulating a number of small functions, which I have sensibly put
in a single file called 'util.py'. But it occurs to me that with such a
generic name it could cause problems with other modules not written by
myself. Whats the best way of handling this? If I put it in a
Jeremy Bowers wrote:
I'd point out that the Zen that can be comprehended by checking off items
in a list is not the true Zen.
The Zen that can be imported is not the eternal Zen. =)
--
http://mail.python.org/mailman/listinfo/python-list
Michael Spencer wrote:
Grant Edwards wrote:
Thanks. The stuff provided by the "new" module is what I was
missing.
No magic in the 'new' module - new.instancemethod is just a synonym for
the method type:
>>> import new, types
>>> new.instancemethod is types.MethodType
True
(Assuming you're usin
On Fri, 2005-03-04 at 08:36 -0800, gf gf wrote:
> Is there a better, more FP style, more Pythonic way to
> write this:
>
> def compute_vectors(samples, dset):
> vectors = {}
> for d in dset:
> vectors[d] = [sample.get_val(d) for sample in
> samples]
> return vectors
On Sat, 2005-03-05 at 00:00 -0700, Dave Benjamin wrote:
> On Fri, 2005-03-04 at 08:36 -0800, gf gf wrote:
> > Is there a better, more FP style, more Pythonic way to
> > write this:
> >
> > def compute_vectors(samples, dset):
> > vectors = {}
> > f
I have a tkinter 'Text' and 'Scrollbar' connected and working
normally. When a new line of text is inserted (because I'm monitoring
an output stream), I'd like the text and scrollbar to be scrolled to
the bottom, so the latest line of text is always shown. How to
Martin Franklin <[EMAIL PROTECTED]> writes:
> text.yview_pickplace("end")
Thank you, works perfectly!
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
root.after() would be safe? I'm doing this in a
GUI without any problems, so far. Thanks,
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
this helps:
#!/bin/sh
exec python $HOME/opt/python-2.3/lib/python2.3/pdb.py "$@"
--
Benjamin Rutt
--
http://mail.python.org/mailman/listinfo/python-list
Steve Holden wrote:
Brad Tilley wrote:
Matt Gerrans wrote:
Anyway, what's to worry about?When the time comes just whip out a
little script that converts Python 1.6 (or whatever you like) to
Python3K; it will only take seven lines of P3K code.
How about 'import classic'
... or
from __past__
27;s about the closest
I've found so far.
--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>, Fredrik Lundh wrote:
> Dave Benjamin wrote:
>
>> I looked around for recordings of Guido, but couldn't find any.
>
> http://www.python.org/~guido/guido.au
I found a few--slightly longer--video interviews here today:
http://technet
In article <[EMAIL PROTECTED]>, Jimmy Retzlaff wrote:
> Dave Benjamin wrote:
>> I looked around for recordings of Guido, but couldn't find any. Does
>> anyone know of any streamable audio (or video) interviews or speeches
>> featuring Guido, the bots, or any
t across all styles of programming.
Interestingly, Python's main unit of modularity is the "module", not the
"class". A direct translation of a typical Python module to Java would look
something like a Java class containing only static methods and inner classes.
Even this would
t impression that the results of the operation are
> precise. Decimals will be converted to rationals before the
> operation. [Open question: is this the right thing to do?]
Sounds right to me.
Cheers,
Dave
--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:
Mike Meyer wrote:
"Robert Brewer" <[EMAIL PROTECTED]> writes:
Why aren't built
in lists and dictionaries real heritable types that can save
this kind of patchwork?
They are since Python 2.2 (IIRC):
And before Python 2.2 there was the UserList class in the standard
library. Which is still there in
;
>
> I'm also a bit puzzled that www.ironpython.com has no mention of this
> release.
> Curious that J Hugunin didn't announce it himself.
Jim Hugunin announced it himself in a keynote at PyCon. You can read a lot
about it on Python centric blogs - just one example:
http://
whereas the second script outputs
---
Content-type: text/plain\r\n
\n
Allele...
---
The (required) "\n" - that should also be an "\r\n" - seperating the headers
from the content is added by the first print.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
just go to planetpython.org
>
Or check out the Daily Python URL (http://www.pythonware.com/daily/) which
has a pretty high signal to noise ratio.
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
ions =
raise AttributeError("'Surface' object has no attribute '%s'. Did you
mean %s?" % (name, suggestions))
I leave it to the experts to wrap this into a generic metaclass, decorator
etc. ;)
--
Benjamin Niemann
Email: pink at odahoda dot de
WWW: http://www.odahoda.de/
--
http://mail.python.org/mailman/listinfo/python-list
Folks,
With Windows XP, and Python v2.41 I am running into a problem
The following code gives me an unknown protocol error And I am not
sure how
to resolve it...
I have a API written for DocuShare for a non-SSL server, and I wanted
to update it
to support the SSL/S3 login
So here's
n popping
up quite a bit lately, and they don't seem unreasonably slow to me. (CPUs
have of course exploded in speed in the past few years.)
--
.:[ dave benjamin: ramen/[sp00] -:- spoomusic.com -:- ramenfest.com ]:.
"talking about music is like dancing about architecture."
--
http://mail.python.org/mailman/listinfo/python-list
Michael Hoffman wrote:
Paul Miller wrote:
> I see lambda is "going away", so I want to use something that will be
> around for awhile.
>
> All I want to do is provide an "inline function" as an argument to
> another function.
That's what lambda does. But it's going away, you'll have to use d
Paul Miller wrote:
Michael Hoffman wrote:
Dave Benjamin wrote:
I think you meant to write something like this:
def attrsetter(obj, name, value):
def _return_func():
return setattr(obj, name, value)
return _return_func
Sure did. Sorry.
You guys have been very helpful!
While on the
Dave Benjamin wrote:
You could use a combination of bound methods and the "curry" function
defined in the Python Cookbook:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52549
The examples in the discussion do just that.
Also, in the CVS version of Python, there's a ne
701 - 800 of 2094 matches
Mail list logo