[Grant Edwards]
>> ...
>> The low 32 bits match, so perhaps you should just use that
>> portion of the returned hash?
>>
>> >>> hex(12416037344)
>> '0x2E40DB1E0L'
>> >>> hex(-468864544 & 0x)
>> '0xE40DB1E0L'
>>
>> >>> hex(12416037344 & 0x)
>> '0xE40DB1E0L'
>> >>> hex
In article <[EMAIL PROTECTED]>,
"Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote:
>Lawrence D'Oliveiro wrote:
>> In article <[EMAIL PROTECTED]>,
>> "Carl J. Van Arsdall" <[EMAIL PROTECTED]> wrote:
>>
>>
>>> Well, running the make on the command line seems to work just fine, no
>>> errors at a
Astan Chee wrote:
> now the file Im trying to read has recently had alot of read/writes from
> other users/threads/etc, so every now and again I get a
> IOError: [Errno 9] Bad file descriptor
> I know this has something to do with not being able to read while some
> filehandles are open (or is
> You'll need to make your own AccessControl/ZopeGuards.py-like module, and
> probably subclass the RestrictionMutator to enable/disable certain
> functionnality (interdiction of names beginning by '_' for example is hard
> coded).
Your reply is pretty hopeful, I saw that one, its the only fracti
JK,
You are correct to implement __hash__ and __eq__. The problem is how
you implemented them. Usually your __eq__ method should compare the
necessary attributes of the objects for equality. The __hash__ should
return a 32-bit integer. Your best bet is probably to return a hash of
hashes of your a
Carl J. Van Arsdall wrote:
> I'm not sure the proper way to phrase the question, but let me try.
>
> Basically, I'm working with a script where someone wrote:
>
> kr = string.strip(os.popen('make kernelrelease').read())
>
>
> And then searches kr to match a regular expression.
>
> This seems t
Chris Spencer wrote:
> Before I get too carried away with something that's probably
> unnecessary, please allow me to throw around some ideas. I've been
> looking for a method of transparent, scalable, and human-readable object
> persistence, and I've tried the standard lib's Shelve, Zope's ZODB,
>
Qiangning Hong wrote:
> /.../ add a "hash" column in the table, make it a unique key
at this point, you should have slapped yourself on the forehead, and gone
back to the drawing board.
--
http://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
> On Wed, 12 Jul 2006 02:48:44 +0200, Bruno Desthuilliers
> <[EMAIL PROTECTED]> declaimed the following in
> comp.lang.python:
>
>
>>nate a écrit :
>>
>>>I'd like a module than I'm importing to be able to use objects in the
>>>global namespace into which it's been importe
Steven D'Aprano schreef:
> If seq can be None as well as a sequence, doing a test "if len(seq) > 0"
> won't save you because len(None) will fail. You need an explicit test
> for seq being None:
>
> if seq is not None and len(seq) > 0
>
> Or even better:
>
> if seq
>
> which Just Works regardles
pipehappy wrote:
>> hi all,
>> how to get out of the python shell which is executing a command?
>> how to use images in the background of a page in Tkinter?
>
> on Unix, ctrl-c or ctrl-d may do the job.
> on Windows, ctrl-z will do
>
Hi I presume you meant putting a image as a background for a T
On 9 Jul 2006 16:42:27 -0700
[EMAIL PROTECTED] wrote:
> Hi,
>
> I already have a couple of newbie books on Python itself, but
> would rather get started with a nice to use IDE and I am
> therefore looking for a good IDE to learn Python.
>
> Is there a good IDE which would be well documented out
On Sun, 09 Jul 2006 03:41:52 +0300
IOANNIS MANOLOUDIS <[EMAIL PROTECTED]> wrote:
> I want to learn python.
I am looking for a book which will help
> me get started and should contain the foundations. I am not
> looking for the Python bible. Any recommendations?
> Ioannis
>
Hmm, no one has mentio
On 2006-07-11, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
>> Antoon Pardon <[EMAIL PROTECTED]> (AP) wrote:
>
>>AP> As I read the language reference the x stands for a target expression.
>>AP> Now what does it mean to evaluate a target expression like col[key].
>>AP> IMO it means finding the lo
Chris,
Interesting concept. But why is there a need for a human readable
object persistence that is x10 slower than pickle? In other words
present a good use case with a rationale (i.e. your "criteria" that you
mentioned). The only one I can think of so far is debugging.
Also some objects are inh
Lousy Attribute Name:
self.tmp
Accessors:
set_temporary_buffer
get_temporary_buffer
The attribute name I chose, "tmp" sucks. I have used that name in
dozens of places spanning over 27000 LOC. There's a chance that other
develops might misinterpret exactly what "tmp" does.
Using Python's hash as column in the table might not be a good idea.
You just found out why. So you could instead just use the base url and
create an index based on that so next time just quickly get all urls
from same base address then do a linear search for a specific one, or
even easier, impleme
Good point about isinstance. Here is a good explanation why:
http://www.canonical.org/~kragen/isinstance/
Also the frozenset should be added the list of immutable types.
Nick Vatamaniuc
Bruno Desthuilliers wrote:
> Chris Spencer wrote:
> > Before I get too carried away with something that's prob
David Hopwood wrote:
> George Neuner wrote:
>>
>>All of this presupposes that you have a high level of confidence in
>>the compiler. I've been in software development for going in 20 years
>>now and worked 10 years on high performance, high availability
>>systems. In all that time I have yet to m
Le mercredi 12 juillet 2006 11:17, mystilleef a écrit :
> Yes, it is possible to name crappy accessors too (e.g set_tmp/get_tmp).
> But developers tend to pay more attention to given methods/functions
> less crappy names, at least when compared to data attributes.
Not python developers.
> This
>
"Schüle Daniel" wrote:
> > a = [[] for in range(200)]
>
> correction :)
>
> a = [[] for i in range(200)]
the "*500" part still seems to be missing...
--
http://mail.python.org/mailman/listinfo/python-list
> Grant Edwards <[EMAIL PROTECTED]> (GE) wrote:
>GE> The low 32 bits match, so perhaps you should just use that
>GE> portion of the returned hash?
If the hashed should be unique, 32 bits is much too low if you have
millions of entries.
--
Piet van Oostrum <[EMAIL PROTECTED]>
URL: http://www.
The hash is not expected to be unique, it just provides a starting point
for another search (usually linear ?).
See http://en.wikipedia.org/wiki/Hash_function
Helpfully,
Maybe,
Richard.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On
Behalf Of Piet van Oos
Hi,
I've written a script which backs up a huge bunch of files, but I
don't want the script to output the file names as it does this as it
clutters the screen, I only output errors.
So in order to see that the script is working and not stuck, I'd like to
implement some kind of progress bar o
"Kerry, Richard" <[EMAIL PROTECTED]> writes:
> The hash is not expected to be unique, it just provides a starting point
> for another search (usually linear ?).
The database is good at organizing indexes and searching in them. Why
not let the database do what it's good at.
--
http://mail.pytho
Hari Sekhon wrote:
> I've written a script which backs up a huge bunch of files, but I
> don't want the script to output the file names as it does this as it
> clutters the screen, I only output errors.
>
> So in order to see that the script is working and not stuck, I'd like to
> implement some
"3c273" wrote:
> Doh! Me thinks Windows at work "python /?" (No good!)
that was supposed to be fixed in 2.5, but it doesn't seem to have made it into
beta 2. hmm.
--
http://mail.python.org/mailman/listinfo/python-list
Tim Heaney wrote:
> Several different people have written modules to help you read (and
> write) ID3 tags.
On a related topic, I have a Perl module that reads MP4/AAC tags -
http://search.cpan.org/~jhar/MP4-Info/ - that I'm considering porting to
Python.
But before I start, is anyone aware of an
Helmut Jarausch wrote:
> Hi,
>
> I'm still looking for an elegant and clear means to
> terminate the main script in Python.
>
> Unfortunately, Python doesn't allow a 'return'
> instruction in the main script.
>
It is quite a common practice for Python scripts to define a main()
function which conta
Hi,
the code:
from Numeric import *
def my_minimum(a):
n=shape(a)[0]
x = 1.0e20
for i in range(n):
if a[i] < x:
x = a[i]
return x
def strange(a):
a[3] = -6303.0
h = my_minimum(a)
for i in range(10)
mystilleef wrote:
> Lousy Attribute Name:
> self.tmp
>
> Accessors:
> set_temporary_buffer
> get_temporary_buffer
>
> The attribute name I chose, "tmp" sucks.
Well, it's surely not as descriptive as 'temporary_buffer'
> I have used that name in
> dozens of places spanning over
[EMAIL PROTECTED] wrote:
> Hi,
> I want to generate all non-empty substrings of a string of length >=2.
> Also,
> each substring is to be paired with 'string - substring' part and vice
> versa.
> Thus, ['abc'] gives me [['a', 'bc'], ['bc', 'a'], ['ab', 'c'], ['c',
> 'ab'], ['b', 'ac'], ['ac', 'b
Hello:
Is there a global or some trick I can use to have
Python remember the last directory visited?
What I mean is suppose I have this function:
def get_filename():
""" Returns a filename selected from a Tkinter File Selection Dialog """
strFilename = tkFileDialog.askopenfilename(i
On 2006-07-10, sreekant <[EMAIL PROTECTED]> wrote:
> Hi folks
>
> What am I doing wrong in the following? I just want to run fluidsynth in
> the background.
> #
> class MyThread(threading.Thread):
> def __init__(self, cmd, callback):
> self.__c
On Wed, 12 Jul 2006 07:29:18 -0400, Michael Yanowitz wrote:
> but instead of having initialdir='.' (current directory), I
> would like it set to the last visited directory, which can be from a
> previous run or even a previous day. Is that possible? If so how?
Every time you open a file, save
Your message with Subject: Important
could not be delivered to the following recipients:
[EMAIL PROTECTED]
Please do not resend your original message.
Delivery attempts will continue to be made for 4 day(s).
--
http://mail.python.org/mailman/listinfo/python-list
Hi all,
Why doesn't the following code work on Windows XP, although it works
on Linux (Ubuntu 6.06). Both versions are of Python are 2.4, and both
OSs are on the same PC.
>>> import unicodedata
>>> unicodedata.name(U'\U0001d400')
Traceback (most recent call last):
File "", line 1, in ?
TypeError
Hari> So in order to see that the script is working and not stuck, I'd
Hari> like to implement some kind of progress bar or something, ...
Here's mine:
http://orca.mojam.com/~skip/python/progress.py
There are both Progress and Counter classes. Same idea, different output.
Skip
--
is it possible to get the list of search results from the search box from
wxPython's wxHtmlHelpControl without it displaying GUI? i don't see an obvious
way to do this.
thanks,
bryan
--
http://mail.python.org/mailman/listinfo/python-list
Bryan wrote:
> is it possible to get the list of search results from the search box from
> wxPython's wxHtmlHelpControl without it displaying GUI? i don't see an
> obvious
> way to do this.
>
> thanks,
>
> bryan
>
i meant wxPython's wxHtmlHelpController
--
http://mail.python.org/mailman/l
I am trying to install Python 2.4.3 on an AMD Opteron system using
the Portland Group's compiler (pgcc). Using
CC="pgcc -DNCURSES_ENABLE_STDBOOL_H=0" OPT="-O0" LINKFORSHARED="-Wl,-
export-dynamic" ./configure --without-cxx
I finally managed to obtain an executable that would start and work,
Hi there,
I'm sure there is a very simple solution for my question, I just didn't
find it up to now.
I'm using a badly documented module and therefore need to find out
about how to access the elements in a list.
(I need to do this in Python 1.5.3)
Any help appreciated very much. Thanks!
cz
--
> I'm using a badly documented module and therefore need to find out
> about how to access the elements in a list.
> (I need to do this in Python 1.5.3)
I presume this is the same in 1.5 use dir():
>>> import os
>>> dir(os)
['F_OK', 'O_APPEND', 'O_BINARY', 'O_CREAT', 'O_EXCL', 'O_NOINHERIT',
'O_
> Yes, it is possible to name crappy accessors too (e.g set_tmp/get_tmp).
> But developers tend to pay more attention to given methods/functions
> less crappy names, at least when compared to data attributes. This
In my experience of getters and setters in Java, most developers choose
attribute n
On Wed, 12 Jul 2006 05:17:30 -0700, cz wrote:
> Hi there,
>
> I'm sure there is a very simple solution for my question, I just didn't
> find it up to now.
> I'm using a badly documented module and therefore need to find out
> about how to access the elements in a list.
Er, the same way you would
I recommend "The Quick Python Book" by Harms and McDonald. Its
strength is its brevity and *readability* -- you can actually just sit
down and read it and enjoy it. It doesn't cover the newest features of
Python or the most advanced, but that is not necessary in a beginner's
book.
Once you're up
hi all,
I am trying to execute one simple program using pygtk-2.8.6 and
gnome-python-extra-2.12.It's crashing at the time of executing the
follwing instruction.
-
self.moz = gtkmozembed.MozEmbed()
-
> Perhaps you need to rephrase your question.
> --
> Steven.
Thanks for your reply.
OK, I'll try to make this more clear:
My list called "elten" looks like that:
[Tensor: id = 1, intensity = 2976.52
xx = -1447.32, xy = 52.458, xz = -594.186
yy = -1090.54, yz = -0.0158068, zz = -4043.
, Tensor
Hi Claudio,
cz wrote:
>> Perhaps you need to rephrase your question.
>> --
>> Steven.
>
> Thanks for your reply.
> OK, I'll try to make this more clear:
> My list called "elten" looks like that:
>
> [Tensor: id = 1, intensity = 2976.52
> xx = -1447.32, xy = 52.458, xz = -594.186
> yy = -1090.
Dennis Lee Bieber wrote:
> On 11 Jul 2006 06:45:42 -0700, [EMAIL PROTECTED] declaimed the
> following in comp.lang.python:
>
> Could it be that the SERVER is limiting things to 5
> concurrent/parallel connections from any single IP?
>
> I know I've encountered sites that only allowed t
> The list above is not a valid Python list. What is it that you store in that
> list?
>
> Or is it maybe a dictionary?
>
> Stefan
Thanks for your help. How can I find out about what this is? As I said
it's generated by a insufficiently documented module. So if this is a
user defined datatype, is
[EMAIL PROTECTED] wrote:
> I'm trying to use ftp in python in a multi-threaded way on a windows
> box - python version 2.4.3. Problem is that it appears that it's only
> possible to have five instances/threads at one point in time. Errors
> look like:
>
>File "C:\Python24\lib\ftplib.py", lin
Hi, I currently have a Python app with a Tkinter GUI frontend that I
use for system administration. Everytime it launches, it reads a text
file which contains info about each host I wish to monitor - each field
(such as IP, hostname, etc.) is delimited by !!. Now, I want to be
able to edit host i
Marshall schrieb:
> Joachim Durchholz wrote:
>> Marshall schrieb:
>>> Now, I'm not fully up to speed on DBC. The contract specifications,
>>> these are specified statically, but checked dynamically, is that
>>> right?
>> That's how it's done in Eiffel, yes.
>>
>> > In other words, we can consider
D wrote:
> Hi, I currently have a Python app with a Tkinter GUI frontend that I
> use for system administration. Everytime it launches, it reads a text
> file which contains info about each host I wish to monitor - each field
> (such as IP, hostname, etc.) is delimited by !!. Now, I want to be
>
cz wrote:
>> The list above is not a valid Python list. What is it that you store in
>> that list?
>>
>> Or is it maybe a dictionary?
>>
>> Stefan
>
> Thanks for your help. How can I find out about what this is? As I said
> it's generated by a insufficiently documented module. So if this is a
> u
>> My list called "elten" looks like that:
>>
>> [Tensor: id = 1, intensity = 2976.52
>> xx = -1447.32, xy = 52.458, xz = -594.186
>> yy = -1090.54, yz = -0.0158068, zz = -4043.
>> , Tensor: id = 26, intensity = 2896.9
>> ...
>> , Tensor: id = 5, intensity = 2920.5
>> xx = -1534.53, xy = 23.
cz schrieb:
>> The list above is not a valid Python list. What is it that you store in that
>> list?
>>
>> Or is it maybe a dictionary?
>>
>> Stefan
>
> Thanks for your help. How can I find out about what this is? As I said
> it's generated by a insufficiently documented module. So if this is a
>
On 2006-07-12, Carl Banks <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2006-07-11, Qiangning Hong <[EMAIL PROTECTED]> wrote:
>>
>> > I'm writing a spider. I have millions of urls in a table (mysql) to
>> > check if a url has already been fetched. To check fast, I am
>> > considering to a
On 2006-07-12, Qiangning Hong <[EMAIL PROTECTED]> wrote:
> Grant Edwards wrote:
>> On 2006-07-11, Qiangning Hong <[EMAIL PROTECTED]> wrote:
>> > However, when I come to Python's builtin hash() function, I
>> > found it produces different values in my two computers! In a
>> > pentium4, hash('a') ->
Darren New schrieb:
> As far as I understand it, Eiffel compilers don't even make use of
> postconditions to optimize code or eliminate run-time checks (like null
> pointer testing).
That's correct.
I think a large part of the reasons why this isn't done is that Eiffel's
semantics is (a) too c
Thanks for the advice. Once assured that __hash__ etc was the right
route, I found that using hash() instead of object.__hash__() gave me
stable hash valules. (I am hashing strings that I know to be unique.)
The "no luck" situation was that a set would accept the same object
multiple times, not
Lets say that I have an application consisting of 3 files. A main.py
file, gui.py and a data.py which handles persistent data storage.
Suppose data.py defines a class 'MyDB' which reads in data from a
database, and main.py creates an instance of this object. How does code
in gui.py access this obje
[EMAIL PROTECTED] wrote:
> Lets say that I have an application consisting of 3 files. A main.py
> file, gui.py and a data.py which handles persistent data storage.
> Suppose data.py defines a class 'MyDB' which reads in data from a
> database, and main.py creates an instance of this object. How do
JKPeck <[EMAIL PROTECTED]> wrote:
> Thanks for the advice. Once assured that __hash__ etc was the right
> route, I found that using hash() instead of object.__hash__() gave me
> stable hash valules. (I am hashing strings that I know to be unique.)
>
> The "no luck" situation was that a set woul
On 12/07/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> If the output of the script is sent to a logfile, this tends to puke all> over the logfile... creating one additional entry per iteration, but it's a> good start and I'll look at that link which looks very promising.
there's no way to do this
D wrote:
> Hi, I currently have a Python app with a Tkinter GUI frontend that I
> use for system administration. Everytime it launches, it reads a text
> file which contains info about each host I wish to monitor - each field
> (such as IP, hostname, etc.) is delimited by !!. Now, I want to be
>
[EMAIL PROTECTED] wrote:
> Lets say that I have an application consisting of 3 files. A main.py
> file, gui.py and a data.py which handles persistent data storage.
> Suppose data.py defines a class 'MyDB' which reads in data from a
> database, and main.py creates an instance of this object. How doe
Hi,
I'd like to have a persistant dictionary in a server so that incoming
requests acquire a specific Python object, do something with it then
return. There wont be that many objects but it is the persistance that
is important here, I want the information to survive server re-starts /
crashes. The
Hari Sekhon wrote:
> Hi,
> I've written a script which backs up a huge bunch of files, but I
> don't want the script to output the file names as it does this as it
> clutters the screen, I only output errors.
>
> So in order to see that the script is working and not stuck, I'd like to
> implemen
Stefan Behnel wrote:
> The list above is not a valid Python list.
there's no Python 1.5.3 either. maybe he's posting from a parallel,
slightly different universe ?
--
http://mail.python.org/mailman/listinfo/python-list
Will McGugan wrote:
> Hi,
>
> I'd like to have a persistant dictionary in a server so that incoming
> requests acquire a specific Python object, do something with it then
> return. There wont be that many objects but it is the persistance that
> is important here, I want the information to survive
Jeremy Jones wrote:
> What does main.py do? Are you creating an instance of the gui thingy?
> If so, you could just pass DataObject into your gui thingy either into
> the constructor or to a setter once you create an instance of it.
It's a wxPython app. I created the GUI initialy using wxGlade
Edin Salković wrote:
> Why doesn't the following code work on Windows XP, although it works
> on Linux (Ubuntu 6.06). Both versions are of Python are 2.4, and both
> OSs are on the same PC.
>
import unicodedata
unicodedata.name(U'\U0001d400')
> Traceback (most recent call last):
> File
Thanks, guys. So overall, would it just be easier (and not too rigged)
if any changes were made by just editing the text file? I want to do
this project the right way, but if it's going to be a big pain to
implement the edit function, just modifying the text file directly
isn't that big of a deal
D wrote:
> Thanks, guys. So overall, would it just be easier (and not too rigged)
> if any changes were made by just editing the text file? I want to do
> this project the right way, but if it's going to be a big pain to
> implement the edit function, just modifying the text file directly
> isn'
Hello everyone:
Is there a way to check the type when do assignment?
if I write:
ab = bc
and want to make sure the return value of isinstance(bc, klass) is True
or I will raise
a exception.
Any suggestion?
--
http://mail.python.org/mailman/listinfo/python-list
Diez B. Roggisch nospam.web.de> writes:
>
> What you should do is to install rlcompleter2...
[snip]
>
> Another option is to look into the source of that module and identify the
> objects created. Documentation is overrated - use the source, Luke!
rlcompleter is overrated, and only works on Uni
D wrote:
> Thanks, guys. So overall, would it just be easier (and not too rigged)
> if any changes were made by just editing the text file? I want to do
> [EMAIL PROTECTED] wrote:
> > Might be overkill - but pickle the data memeber that contains the
> > information. If you use text inste
[EMAIL PROTECTED] wrote:
> Doh! How simple. Why didn't I think of that? I'm too used to procedural
> scripts where you'd just put everything in a global data structure. I
> know this is bad, but it's hard to get out of that mentality.
Sounds like you got it. Just pass it on down as needed.
-
3c273 wrote:
> "John Machin" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> You appear to know what a switch is. I'm therefore surprised that you
>> appear not to
>> know that the convention is that any program that uses
>> command-line switches should do something informative whe
pipehappy gmail.com> writes:
>
> Hello everyone:
>
> Is there a way to check the type when do assignment?
>
> if I write:
> ab = bc
> and want to make sure the return value of isinstance(bc, klass) is True
> or I will raise
> a exception.
>
> Any suggestion?
>
1. Check your condition before
Hello,
I am using some very large dictionaries with keys that are long strings
(urls). For a large dictionary these keys start to take up a
significant amount of memory. I do not need access to these keys -- I
only need to be able to retrieve the value associated with a certain
key, so I do not w
pipehappy wrote:
> Hello everyone:
>
> Is there a way to check the type when do assignment?
>
> if I write:
> ab = bc
> and want to make sure the return value of isinstance(bc, klass) is True
> or I will raise
> a exception.
In general, not doable. The assignment operator is not overloadable.
> rlcompleter is overrated, and only works on Unix/Linux/etc.
>
> IDLE's interpreter has an auto-completion extension, which is bundled in
> Python2.5.
I don't use idle, and don't want to. So for me rlcomlpeter2 is a good thing.
And under windows, it at least works under cygwin.
Diez
--
http:/
akameswaran gmail.com gmail.com> writes:
>
>
> D wrote:
> > Thanks, guys. So overall, would it just be easier (and not too rigged)
> > if any changes were made by just editing the text file?
[snip]
> have you used pickle? if the data is as simple as you say it is, you
> will be able to read
Le mercredi 12 juillet 2006 17:00, D a écrit :
> Thanks, guys. So overall, would it just be easier (and not too rigged)
> if any changes were made by just editing the text file? I want to do
> this project the right way, but if it's going to be a big pain to
> implement the edit function, just mo
Thanks so much for your help on this. The server that I'm connecting
to is the culprit. They only allow five connections at a time.
I assumed that it was a code issue. I think that we're conditioned to
expect that the problem is on the software side of things.
-Derek
[EMAIL PROTECTED] wrote:
[EMAIL PROTECTED] wrote:
> Hello,
> I am using some very large dictionaries with keys that are long strings
> (urls). For a large dictionary these keys start to take up a
> significant amount of memory. I do not need access to these keys -- I
> only need to be able to retrieve the value associate
[EMAIL PROTECTED] wrote:
> Jeremy Jones wrote:
>
>
>>What does main.py do? Are you creating an instance of the gui thingy?
>>If so, you could just pass DataObject into your gui thingy either into
>>the constructor or to a setter once you create an instance of it.
>
>
> It's a wxPython app. I c
Diez B. Roggisch wrote:
> pipehappy wrote:
>
>
>>Hello everyone:
>>
>>Is there a way to check the type when do assignment?
>>
>>if I write:
>>ab = bc
>>and want to make sure the return value of isinstance(bc, klass) is True
>>or I will raise
>>a exception.
>
>
> In general, not doable. The assi
JK,
As a general rule, let Python call the "magic" __method__ methods
behind the scenes. So don't call obj.__hash()__ or obj.__len__ or
obj.__le__ just use hash(obj), len(obj) or <=. Of course there are
exceptions, for example when calling the __init__() method of a
supercalass inside the __init__
Installing a Python package is easy, most of time just
"Setup.py install" However, setup.py doesn't seem to support
an uninstall command. If I want to delete a package that I
do not use any more, should I just manually delete the
corresponding sub directory under Lib\site-packages?
--
http://ma
Joachim Durchholz wrote:
> Darren New schrieb:
> > As far as I understand it, Eiffel compilers don't even make use of
> > postconditions to optimize code or eliminate run-time checks (like null
> > pointer testing).
>
> That's correct.
>
> I think a large part of the reasons why this isn't done is
[EMAIL PROTECTED] wrote:
> Will the hash function always generate unique keys?
no. hash() is designed for dictionaries (hash tables), not for use as a
cryptographic hash.
depending on your application, a bloom filter might be a good enough:
http://en.wikipedia.org/wiki/Bloom_filter
(see
[EMAIL PROTECTED] wrote:
> I just realized that of course the hash is not always going to be
> unique, so this wouldn't really work. And it seems a hash table would
> still need to store the keys (as strings) so that string comparisons
> can be done when a collision occurs.
btw, Python's diction
I want to generate a report and the PDF fits perfectly. Though there is
an issue of using different encoding in the doc. I tried PyPS with no
success. I need a lib that can make PDFs with an arbitrary set of fonts
(possibly embed them into the document). What would you suggest?
--
http://mail.
[EMAIL PROTECTED] wrote:
> Hello,
> I am using some very large dictionaries with keys that are long strings
> (urls). For a large dictionary these keys start to take up a
> significant amount of memory. I do not need access to these keys -- I
> only need to be able to retrieve the value associat
Joachim Durchholz wrote:
> Marshall schrieb:
>
> > I can certainly see how DbC would be useful without subtyping.
> > But would there still be a reason to separate preconditions
> > from postconditions? I've never been clear on the point
> > of differentiating them (beyond the fact that one's covar
pipe,
In general it is not possible in one line. You have to do it before
hand or after with an if statement.
As a sidenote though you probably shouldn't use isinstance(), you might
need it less than you think you do, especially if you are using it to
check for some interface. For example, do you
1 - 100 of 174 matches
Mail list logo