Python 3000 (a.k.a. "Py3k", and released as Python 3.0) is a new
version of the language that is incompatible with the 2.x line of
releases. The language is mostly the same, but many details,
especially how built-in objects like dictionaries and strings work,
have changed considerably, and a lot of
Christian Heimes wrote:
> bMotu wrote:
>> IDLE 2.6
> import os
> os.extsep
>> '.'
>> running XP this result is fine ... !
>>
>> IDLE 3.0rc3
> import os
> os.extsep
>> Traceback (most recent call last):
>> File "", line 1, in
>> os.extsep
>> AttributeError: 'module' object has
On Mon, 24 Nov 2008 00:44:45 -0500, r0g wrote:
> Hi there,
>
> I'm trying to validate some user input which is for the most part simple
> regexery however I would like to check filenames and I would like this
> code to be multiplatform.
>
> I had hoped the os module would have a function that wo
bMotu wrote:
IDLE 2.6
import os
os.extsep
'.'
running XP this result is fine ... !
IDLE 3.0rc3
import os
os.extsep
Traceback (most recent call last):
File "", line 1, in
os.extsep
AttributeError: 'module' object has no attribute 'extsep'
why is this attribute gone in 3.0rc3 ?
where
On Mon, 24 Nov 2008 00:46:42 +0100, Gilles Ganault wrote:
> On Sun, 23 Nov 2008 23:18:06 +, MRAB <[EMAIL PROTECTED]>
> wrote:
>>A list is an ordered collection of items. Each item can be anything: a
>>string, an integer, a dictionary, a tuple, a list...
>
> Yup, learned something new today. N
Glenn Linderman wrote:
> On approximately 11/23/2008 9:17 PM, came the following characters from
> the keyboard of GALLOWAY Stuart J (SVHM):
>
> But, hey, a portable version of Python would be nice! Would probably
> make the job of the various packagers that make .exe files easier, too!
Erm, a c
On Sun, 23 Nov 2008 21:10:34 -0500, python wrote:
> Is there a formula for determining the approximate size of a dictionary
> (minus its data) under 32 and 64 bit Python with a specific average key
> size?
If you're using Python 2.6, the sys module has a new function getsizeof()
which returns th
Hi there,
I'm trying to validate some user input which is for the most part simple
regexery however I would like to check filenames and I would like this
code to be multiplatform.
I had hoped the os module would have a function that would tell me if a
proposed filename would be valid on the host
On approximately 11/23/2008 9:17 PM, came the following characters from
the keyboard of GALLOWAY Stuart J (SVHM):
I would strongly recommend that an official PORTABLE python for
windows should be a standard distribution so we can bypass all the
windows rubbish if we want to.
Sorry about th
On approximately 11/23/2008 9:17 PM, came the following characters from
the keyboard of GALLOWAY Stuart J (SVHM):
I accept that this may be essentially a VISTA problem.
So, upgrade to XP, until Microsoft fixes Vista! I've got 3 versions of
Python running here on XP! No problems installing!
I had python 2.5 on my computer and did a double install with 2.6 out of
curiosity.
Python 2.5 and idle had been working.
I was logged on as administrator (only user account on my computer) and
installed python2.6 for all users.
Python 2.6 idle did not work, and following installation nor did
En Fri, 21 Nov 2008 17:39:14 -0200, Stef Mientki <[EMAIL PROTECTED]>
escribió:
Gabriel Genellina wrote:
En Thu, 20 Nov 2008 17:36:11 -0200, Stef Mientki
<[EMAIL PROTECTED]> escribió:
I'm not an expert, I even don't fully understand your problem,
but having struggled with imports in the past,
On Nov 21, 5:02 pm, Rafe <[EMAIL PROTECTED]> wrote:
> On Nov 21, 4:50 pm, Rafe <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi,
>
> > I'm getting this error:
> > # File "C:\Python25\Lib\site-packages\win32com\client\dynamic.py",
> > line 491, in __getattr__
> > # raise pythoncom.com_error, details
>
John Machin wrote:
> "the lists will directly correspond"? What does that mean?
It means that e.g. zip(d.keys(), d.values()) == d.items() is guaranteed
to be True.
> Why not
> "the lists will be equal i.e. list1 == list2"?
>
> How about "Provided that keys are neither added nor deleted, the ord
What are the pros and cons of these two patterns (and are there any
other)? Which is the best way to dynamically get an attribute from a
module from within the same module?
1) Using the name of the module
this_module = sys.modules[__name__]
attr = getattr(this_module, "whatever", None)
2)
On Nov 22, 9:02 am, Steven D'Aprano <[EMAIL PROTECTED]
cybersource.com.au> wrote:
> On Fri, 21 Nov 2008 15:11:20 -0700, Joe Strout wrote:
> > I have a function that takes a reference to a class,
>
> Hmmm... how do you do that from Python code? The simplest way I can think
> of is to extract the nam
Is there a formula for determining the approximate size of a dictionary
(minus its data) under 32 and 64 bit Python with a specific average key
size?
For instance, if we were running a 64-bit version of Python and created
a dictionary of 1 million items with an average key length of 48 bytes,
is
On Nov 24, 11:59 am, Carsten Haese <[EMAIL PROTECTED]> wrote:
> Diez B. Roggisch wrote:
> > AFAIK the order is deterministic as long as you don't alter the dict between
> > iterations. However, this is an implementation detail.
>
> It's not an implementation detail. It's documented behavior. Thus
if I remember correctly, wasn't there a way to quickly iterate through
nested loops? Something like
a = { "a", "b", "c" }
b = { 4, 9, 13}
for (x, y) in someoperator(a, b):
print(x, y)
You may be reaching for this thread:
http://mail.python.org/pipermail/python-list/2008-January/473650.
alex23 wrote:
On Nov 24, 9:59 am, bMotu <[EMAIL PROTECTED]> wrote:
AttributeError: 'module' object has no attribute 'extsep'
why is this attribute gone in 3.0rc3 ?
where is this documented ?
According to the 3.0 docs, it should still be there. But I'm finding
the same with rc2. Looks like a
Diez B. Roggisch wrote:
> AFAIK the order is deterministic as long as you don't alter the dict between
> iterations. However, this is an implementation detail.
It's not an implementation detail. It's documented behavior. Thus quoth
http://docs.python.org/library/stdtypes.html#mapping-types-dict :
On Nov 24, 9:59 am, bMotu <[EMAIL PROTECTED]> wrote:
> AttributeError: 'module' object has no attribute 'extsep'
>
> why is this attribute gone in 3.0rc3 ?
>
> where is this documented ?
According to the 3.0 docs, it should still be there. But I'm finding
the same with rc2. Looks like a bug.
It's
So, I'm locked into a Bluehost contract for a couple years. Was using
Perl when I signed up. Only took a few hours to get my site moved from
my previous host, also cPanel based... a few tweaks and it was running.
They seem to be OK, but their help forums are pretty sparse... no
references to
Good point. What about
d = {1: []}
d[1].append(2)
Has d changed or not?
Which just goes to show that the SDict implementation above is, as
suspected by the author, incomplete for the purpose of detecting all
changes to the dict, as well as detecting some that might not be
IDLE 2.6
>>> import os
>>> os.extsep
'.'
running XP this result is fine ... !
IDLE 3.0rc3
>>> import os
>>> os.extsep
Traceback (most recent call last):
File "", line 1, in
os.extsep
AttributeError: 'module' object has no attribute 'extsep'
why is this attribute gone in 3.0rc3 ?
where is
On Sun, 23 Nov 2008 23:18:06 +, MRAB <[EMAIL PROTECTED]>
wrote:
>A list is an ordered collection of items. Each item can be anything: a
>string, an integer, a dictionary, a tuple, a list...
Yup, learned something new today. Naively, I though a list was
index=value, where value=a single piece
Gilles Ganault wrote:
On Sun, 23 Nov 2008 17:55:48 +, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
But there is no reason why you should use a dictionary; just use a list
of key-value pairs:
Thanks for the tip. I didn't know it was possible to use arrays to
hold more than one value. Actuall
John Machin wrote:
> On Nov 22, 11:04 am, r0g <[EMAIL PROTECTED]> wrote:
On Nov 21, 10:18 am, Chuck Connors <[EMAIL PROTECTED]> wrote:
> Any help, pseudo code, or whatever push in the right direction would
> be most appreciated. I am a novice Python programmer but I do hav
On Sun, 23 Nov 2008 17:55:48 +, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
>But there is no reason why you should use a dictionary; just use a list
>of key-value pairs:
Thanks for the tip. I didn't know it was possible to use arrays to
hold more than one value. Actually, it's a better solutio
On Nov 24, 7:49 am, Thomas Mlynarczyk <[EMAIL PROTECTED]>
wrote:
> John Machin schrieb:
>
> > General tip: Don't us a data structure that is more complicated than
> > what you need.
>
> Is "[ ( name, regex ), ... ]" really "simpler" than "{ name: regex, ...}"?
> Intuitively, I would consider the d
On Nov 12, 2:54 am, Thomas Mlynarczyk <[EMAIL PROTECTED]>
wrote:
> John Machin schrieb:
>
> > You are getting closer. A better analogy is that using a dict is like
> > transporting passengers along an autobahn in an aeroplane or
> > helicopter that never leaves the ground.
>
> It is not a bad idea
On Nov 24, 7:48 am, John Machin <[EMAIL PROTECTED]> wrote:
> On Nov 24, 5:36 am, Terry Reedy <[EMAIL PROTECTED]> wrote:
>
> > print name + '#' + regex
>
> Perhaps you meant:
> print key + "#" + regex.pattern
I definitely meant:
print name + '#' + regex.pattern
--
http://mail.python.org/mailm
Tres Seaver wrote:
> Nick Coghlan wrote:
>> Antoine Pitrou wrote:
>>> Brett Cannon python.org> writes:
It is specifically there to be overridden (and as an aside, it was a
pain to support in the C port of warnings), so it really isn't
monkey-patching. =)
>>> Should we coin a new wor
On approximately 11/23/2008 9:50 AM, came the following characters from
the keyboard of Arnaud Delobelle:
Glenn Linderman <[EMAIL PROTECTED]> writes:
On approximately 11/23/2008 1:40 AM, came the following characters
from the keyboard of Steven D'Aprano:
On Sun, 23 Nov 2008 01:18:17 -0
On Nov 23, 1:40 pm, Gilles Ganault <[EMAIL PROTECTED]> wrote:
> Hello
>
> After downloading a web page, I need to search for several patterns,
> and if found, extract information and put them into a database.
>
> To avoid a bunch of "if m", I figured maybe I could use a dictionary
> to hold the pat
John Machin schrieb:
General tip: Don't us a data structure that is more complicated than
what you need.
Is "[ ( name, regex ), ... ]" really "simpler" than "{ name: regex, ...
}"? Intuitively, I would consider the dictionary to be the simpler
structure.
Greetings,
Thomas
--
Ce n'est pas
This mailinglist is about the Python programming language, not Gmail;
thus, your question is completely irrelevant.
I would suggest you ask your question in
http://groups.google.com/group/Gmail-Help-Discussion instead.
Cheers,
Chris
--
Follow the path of the Iguana...
http://rebertia.com
On Sun,
On Nov 24, 5:36 am, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Gilles Ganault wrote:
> > Hello
>
> > After downloading a web page, I need to search for several patterns,
> > and if found, extract information and put them into a database.
>
> > To avoid a bunch of "if m", I figured maybe I could use a
On Nov 24, 6:55 am, Gilles Ganault <[EMAIL PROTECTED]> wrote:
> On Sun, 23 Nov 2008 17:55:48 +, Arnaud Delobelle
>
> <[EMAIL PROTECTED]> wrote:
> >But there is no reason why you should use a dictionary; just use a list
> >of key-value pairs:
>
> >patterns = [
> > ("pattern1", re.compile(">.+
On Sun, Nov 23, 2008 at 2:55 PM, Gilles Ganault <[EMAIL PROTECTED]> wrote:
> On Sun, 23 Nov 2008 17:55:48 +, Arnaud Delobelle
> <[EMAIL PROTECTED]> wrote:
> >But there is no reason why you should use a dictionary; just use a list
> >of key-value pairs:
> >
> >patterns = [
> >("pattern1", r
2008/11/23 Gilles Ganault <[EMAIL PROTECTED]>
> Hello
>
> After downloading a web page, I need to search for several patterns,
> and if found, extract information and put them into a database.
>
> To avoid a bunch of "if m", I figured maybe I could use a dictionary
> to hold the patterns, and loop
On Sun, 23 Nov 2008 17:55:48 +, Arnaud Delobelle
<[EMAIL PROTECTED]> wrote:
>But there is no reason why you should use a dictionary; just use a list
>of key-value pairs:
>
>patterns = [
>("pattern1", re.compile(">.+?.+?>(.+?)"),
Thanks for the tip, but... I thought that lists could only us
On Sun, 23 Nov 2008 09:19:38 -0800, Glenn Linderman wrote:
> Interesting technique. I must point out, though, that it doesn't
> indicate if a dict has been changed, only that potentially changing
> operations have been performed.
[...]
> The above code would declare it has, but most people, when
On Sun, 23 Nov 2008 09:24:05 -0600, Derek Martin wrote:
> On Tue, Nov 18, 2008 at 09:23:30AM +, Steven D'Aprano wrote:
>> > How I can answer the question, "are the objects a and b the same or
>> > different"? I can look at every aspect of each object, looking for
>> > something that is differe
Terry Reedy <[EMAIL PROTECTED]> writes:
> George Sakkis wrote:
>> On Nov 23, 6:14 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>>
>>> So how did I get it into my head that defining __eq__ would create the
>>> correct behaviour for __ne__ automatically? And more puzzlingly, how
>>> come it is w
Martin v. Löwis wrote:
Does anyone has a better solution ?
If you have pythonwin, you can use win32file.FindFilesW, passing
the lower-cased file name.
Thanks Martin,
seems to work great.
cheers,
Stef
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
--
http
Gilles Ganault wrote:
Hello
After downloading a web page, I need to search for several patterns,
and if found, extract information and put them into a database.
To avoid a bunch of "if m", I figured maybe I could use a dictionary
to hold the patterns, and loop through it:
Good idea.
import r
George Sakkis wrote:
On Nov 23, 6:14 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
So how did I get it into my head that defining __eq__ would create the
correct behaviour for __ne__ automatically? And more puzzlingly, how
come it is what actually happens? Which should I believe: the
docume
> No criticism was intended. It was merely an RFI.
Not sure whether you got the answer you wanted - when I said
"it is too much effort to build (and too few users)", I really
meant "it is non-zero effort, which is too much".
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
In article <[EMAIL PROTECTED]>,
Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>I can't refer you to the docs because my internet access to some US
>sites seems to be partly broken ATM, but here's a simple example:
BTW, python.org is hosted at XS4ALL in the Netherlands, so if you can't
reach it, i
> Does anyone has a better solution ?
If you have pythonwin, you can use win32file.FindFilesW, passing
the lower-cased file name.
Regards,
Martin
--
http://mail.python.org/mailman/listinfo/python-list
greg wrote:
George Sakkis wrote:
Don't worry, it's not obvious to *anyone* new to Python (and many not-
so-new for that matter).
That's by no means certain, because we only hear from the
people who guessed the wrong way. We have no way of knowing
how many people guessed the right way.
I did
Gilles Ganault <[EMAIL PROTECTED]> writes:
> Hello
>
> After downloading a web page, I need to search for several patterns,
> and if found, extract information and put them into a database.
>
> To avoid a bunch of "if m", I figured maybe I could use a dictionary
> to hold the patterns, and loop th
Glenn Linderman <[EMAIL PROTECTED]> writes:
> On approximately 11/23/2008 1:40 AM, came the following characters
> from the keyboard of Steven D'Aprano:
>> On Sun, 23 Nov 2008 01:18:17 -0800, bearophileHUGS wrote
>>> Stef Mientki:
>>>
I would like to detect if a dictionary has been chang
Hello
After downloading a web page, I need to search for several patterns,
and if found, extract information and put them into a database.
To avoid a bunch of "if m", I figured maybe I could use a dictionary
to hold the patterns, and loop through it:
==
pattern = {}
pattern["pattern1"] = ">.
Derek Martin wrote:
[some stuff, followed by about 32k of unnecessarily quoted crap]
It would be helpful if you'd take the time to trim your replies
appropriately.
regards
Steve
--
Steve Holden+1 571 484 6266 +1 800 494 3119
Holden Web LLC http://www.holdenweb.com/
--
ht
On approximately 11/23/2008 1:40 AM, came the following characters from
the keyboard of Steven D'Aprano:
On Sun, 23 Nov 2008 01:18:17 -0800, bearophileHUGS wrote
Stef Mientki:
I would like to detect if a dictionary has been changed. So I would
like to have a modified-flag.
A soluti
On Nov 21, 8:55 pm, Terry Reedy <[EMAIL PROTECTED]> wrote:
> Christopher wrote:
> >> Yes. It's too much effort to build, and too few users that actually
> >> use it. Users are still free to build it themselves, and to share
> >> the build with others.
>
> > I guess that I don't understand why you f
On Nov 21, 7:35 pm, r0g <[EMAIL PROTECTED]> wrote:
> Martin v. Löwis wrote:
> >> In any case, my concern with dropping a stock python itanium distro
> >> involves the vastly diminished probability that others will provide
> >> Itanium versions of, for example py2exe and pywin32.
>
> > Well, I had b
hello,
when getting a breakpoint from pdb and similar packages,
on Windows, the filename is given in lowercase.
For the caption of my editor, I need the filename in the correct case.
The function below does work reasonable well (path is not in the correct
case),
but I find it weird and much too
George Sakkis <[EMAIL PROTECTED]> writes:
> On Nov 23, 6:14 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
>
>> So how did I get it into my head that defining __eq__ would create the
>> correct behaviour for __ne__ automatically? And more puzzlingly, how
>> come it is what actually happens? Whi
On Nov 21, 3:50 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > I need to compile that module for that release and platform, but I
> > have been unable to discover which MS compiler version and runtime was
> > used to generate the binaries. My understanding is that Python 2.5.2
> > in gener
On Tue, Nov 18, 2008 at 09:23:30AM +, Steven D'Aprano wrote:
> > How I can answer the question, "are the objects a and b the same or
> > different"? I can look at every aspect of each object, looking for
> > something that is different.
>
> Well, sure, if you care *that much* about potentially
On Nov 23, 6:14 am, Arnaud Delobelle <[EMAIL PROTECTED]> wrote:
> So how did I get it into my head that defining __eq__ would create the
> correct behaviour for __ne__ automatically? And more puzzlingly, how
> come it is what actually happens? Which should I believe: the
> documentation or the i
I use windows vista home premium. Whenever I open an incoming message
in my inbox, no images are shown. Also, the option to display all
images does not appear at the top of the message. The only option
shown is "display images below". When I click that option, nothing
happens. I am guessing i must
Steven D'Aprano wrote:
> What does the S stand for?
The S stands for simple.
http://wanderingbarque.com/nonintersecting/2006/11/15/the-s-stands-for-simple/
Stefan
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin:
> As a couple of people have said, you could make a dict subclass that
> notices when you do updates. I think the real answer is a
> "functional" dictionary, which means one that is never updated.
Python V. 2.4, 2.5, 2.6. 3.0 have gained more and more lazy-style
features, this is chan
Paul McGuire wrote:
> On Nov 23, 4:21 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>>
>> I don't know why the interpreter would shut down abruptly, but I
>> suppose you could inspect the traceback to see what exactly caused the
>> exception?- Hide quoted text -
>>
> While you puzzle out the root c
Arnaud Delobelle <[EMAIL PROTECTED]> writes:
>> (BTW, I think your earlier decorator had a bug, in that it failed to
>> define __ne__ but then called "self != other".)
>
> That would be true for Python 2.x but I'm explicitly writing code for
> Python 3 here, which, IIRC, infers != correctly when y
On Nov 23, 4:21 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>
> I don't know why the interpreter would shut down abruptly, but I
> suppose you could inspect the traceback to see what exactly caused the
> exception?- Hide quoted text -
>
While you puzzle out the root cause, could something like thi
r schrieb:
I would like to install minimal version if python 2.6 on a linux laptop
(and no there is not one already installed...i checked)
i have no way to access the net with the laptop.
So basicly i down loaded the 2.6 source and unpacked it on my other
PC.
The files weigh in at 51MB and some c
Andrew <[EMAIL PROTECTED]> writes:
> On Nov 20, 6:53 am, Hrvoje Niksic <[EMAIL PROTECTED]> wrote:
>> Andrew <[EMAIL PROTECTED]> writes:
>> > I'm having a problem in some zope (2.10) code (HTTPResponse.py) where
>> > a method that gets imported somehow evaluates to None in certain cases
>> > which
On Sat, Nov 22, 2008 at 9:31 PM, r <[EMAIL PROTECTED]> wrote:
>
>
> And i know this may be asking alot but:
> where do i put the files before i run "./configure"
> does it matter what directory there in??
> any help here would be great since i am new to linux
> and have never built a python instal
Steven D'Aprano <[EMAIL PROTECTED]> writes:
> On Sat, 22 Nov 2008 09:10:04 +, Arnaud Delobelle wrote:
>
>> That's not surprising. You're measuring the wrong things. If you read
>> what I wrote, you'll see that I'm talking about Fraction.__gt__ being
>> slower (as it is defined in terms of Fr
Stef Mientki <[EMAIL PROTECTED]> writes:
> Now I do it to make a copy of the dictionary and compare it with the
> old one.
> When a change is detected I nake a new copy and interpret the whole
> new dictionary again,
> so I'm not interested in knowing where the change(s) are located.
> This works w
Steven D'Aprano wrote:
On Sun, 23 Nov 2008 01:18:17 -0800, bearophileHUGS wrote:
Stef Mientki:
I would like to detect if a dictionary has been changed. So I would
like to have a modified-flag.
A solution is of course to create a SDict class, that works like a
normal dict, and a
On Sun, 23 Nov 2008 01:18:17 -0800, bearophileHUGS wrote:
> Stef Mientki:
>> I would like to detect if a dictionary has been changed. So I would
>> like to have a modified-flag.
>
> A solution is of course to create a SDict class, that works like a
> normal dict, and also watches for changes and
Stef Mientki:
> I would like to detect if a dictionary has been changed.
> So I would like to have a modified-flag.
A solution is of course to create a SDict class, that works like a
normal dict, and also watches for changes and has an extra boolean
attribute.
Bye,
bearophile
--
http://mail.pytho
Aaron Brady <[EMAIL PROTECTED]> writes:
> Truth and clarity are not tired of this thread.
This is such a marvellously economic way of putting it, it's poetic!
--
Arnaud
--
http://mail.python.org/mailman/listinfo/python-list
hello,
Just like in a normal text editor,
I would like to detect if a dictionary has been changed.
So I would like to have a modified-flag.
(This dictionary is used as a communication channel between processes)
Now I do it to make a copy of the dictionary and compare it with the old
one.
When a
Aleksandar Radulovic wrote:
On Tue, Nov 18, 2008 at 7:07 PM, n00b <[EMAIL PROTECTED]> wrote:
greetings,
i need to log to the db directly and wrote a little script to do so.
since i'm pretty new to python,
i was wondering if a) you could review the enclosed code and b)
provide suggestions to har
81 matches
Mail list logo