On 2/11/2012 3:02 PM, Eric Snow wrote:
> I'm thinking about this partly because of the discussion on
> python-ideas about the perceived challenges of Unicode in Python 3.
> For instance, if frameworks (like django and numpy) could completely
> hide the arguable challenges of Unicode in Python 3--a
On 2/12/2012 12:10 AM, Steven D'Aprano wrote:
> It's not just UTF8 either, but nearly all encodings. You can't even
> expect to avoid problems if you stick to nothing but Windows, because
> Windows' default encoding is localised: a file generated in (say) Israel
> or Japan or Germany will use a
On 2/12/2012 3:12 AM, Steven D'Aprano wrote:
> NTFS by default uses the UTF-16 encoding, which means the actual bytes
> written to disk are \x1d\x040\x04\xe5\x042\x04 (possibly with a leading
> byte-order mark \xff\xfe).
That's what I meant. Those bytes will be interpreted consistently across
all
On 2/12/2012 10:19 PM, Ben Finney wrote:
> If it helps, ASCII art *is* UTF-8 art. So it will be the same in UTF-8.
As will non-ASCII text art:
/l、
゙(゚、 。 7
l、゙ ~ヽ
じしf_, )ノ
--
CPython 3.2.2 | Windows NT 6.1.7601.17640
--
http://mail.python.org/mailman/listinfo/python-list
On 2/13/2012 4:59 PM, Wanderer wrote:
> I think wanting to create a directory if one doesn't exist or do
> nothing if it does exist and just use the existing directory is a
> fairly normal programming need. Apparently this is somewhat
> complicated in Python.
There are new exceptions in 3.3, one o
On 2/15/2012 10:04 AM, Mark Lawrence wrote:
> I didn't realise that this was available until today. It doesn't appear
> to be prominent in the official docs or have I missed something?
> Certainly I'd have thought a couple of sentences here
> http://www.python.org/about/help/ would be justified
On 2/15/2012 3:28 PM, John Nagle wrote:
> Are you doing a conditional import, one that takes place after load
> time? If you do an import within a function or class, it is executed
> when the code around it executes. If you import a file with a
> syntax error during execution, you could get the e
On 2/16/2012 9:33 AM, Chris Angelico wrote:
> On Fri, Feb 17, 2012 at 1:43 AM, Rick Johnson
> wrote:
>> On Feb 15, 4:04 pm, Terry Reedy wrote:
>>> On 2/15/2012 4:51 PM, Alan McKay wrote:
>>>
>>> > Is this the right list?
>>
>> This is neither the "right" or "left" list, however, it may be either
On 2/17/2012 10:51 PM, 8 Dihedral wrote:
> 在 2012年2月18日星期六UTC+8上午9时51分13秒,Michael Torrie写道:
>> On 02/16/2012 10:25 PM, 8 Dihedral wrote:
>> > Android is a customized linux OS used in mobile phones. I don't think
>> > any linux systm has to be locked by JAVA or any JVM to run
>> > applicatio
On 2/23/2012 4:43 PM, Dave Angel wrote:
> First thing I'd do is to disable tab logic in the editor. When you
> press the tab key, there's no excuse for an editor to actually put a tab
> in the file. It should adjust the column by adding the appropriate
> number of spaces.
Unless, of course, yo
On 2/24/2012 1:11 AM, Manish Sharma wrote:
> Still my question is what if I open the file and dont make any changes
> to it and close it again? Can it be possible just by doing these steps
> add indentation to lines? I am not changing the file prefrences to open
> it always with notepad++. Opening
On 2/24/2012 2:32 AM, Ben Finney wrote:
> Are you referring to novice programmers – who, by any reasonable
> definition of “novice”, don't have an opinion on the tabs-versus-spaces
> indentation debate?
>
> Or are you talking about people who are experienced enough to have an
> opinion and expect
On 2/24/2012 5:21 AM, Duncan Booth wrote:
> The original question was about Notepad++ which is nothing at all like
> Notepad.
And I did give the OP an answer about Notepad++ specifically in another
message.
--
CPython 3.2.2 | Windows NT 6.1.7601.17640
--
http://mail.python.org/mailman/listinfo/
On 2/24/2012 6:20 AM, Steven D'Aprano wrote:
> Opinions need to be informed to be better than useless. By definition
> newbies don't have the experience to have informed opinions.
I thought I had implied that I meant informed opinions, but apparently not.
> There are many times that we can't affo
On 2/28/2012 9:54 AM, Smiley 4321 wrote:
> NameError: name 'self' is not defined
self is meaningless outside a class definition. You should refactor your
dump, load and print code as methods inside the class definition, create
an instance and call the methods on that instance.
--
CPython 3.2.2 |
On 3/10/2012 6:34 AM, sl33k wrote:
> I'm trying project euler problem 3 and I've hit the wall with this
> error. What could be the problem here?
>
> l=[]
num=600851475143
i=1
while i<=num:
> ... if num%i==0:
> ... l.append(i)
> ... i+=1
> ... print max(l)
> File "
> To download Python 3.3.0 visit:
>
> http://www.python.org/download/releases/3.3.0/
The Windows links point to 3.3a1 installers, even though the links say
3.3a2.
--
CPython 3.2.2 | Windows NT 6.1.7601.17640
--
http://mail.python.org/mailman/listinfo/python-list
cx_Freeze is the only program that can freeze py3k code that I know of.
I didn't have any major issues with it, but I've only played with it.
In any case, if you're going to roll your own, I'd be happy to help test it.
--
CPython 3.2.2 | Windows NT 6.1.7601.17640
--
http://mail.python.org/mailma
On 4/7/2012 8:07 AM, Bill Felton wrote:
> We are using Python 3.2 and tkinter. It appears, and limited testing bears
> out, that py2app, and presumably py2exe, are not options given lack of 3.x
> support.
cx_Freeze supports Python 3.2. It works fine for my purposes, but I have
not done any serio
On 4/7/2012 11:59 AM, goldtech wrote:
I thought if I SSH
> even from a Linux to a Windows machine whatever I say on the SSH
> client command line would be the same as me doing a command on the
> "DOS" command-line in Windows. I incorrectly thought SSH is just a
> tunnel for text...
It gives you wh
On 4/9/2012 1:52 AM, Chris Angelico wrote:
> I think this will be a real winner, and you
> should team up with Ranting Rick to produce a new operating system and
> Python with this new specification and RULE THE WORLD!
But only after going back to the cage to plan for tomorrow night.
--
CPython 3
On 4/9/2012 5:01 AM, Janis wrote:
> I have this problem with my script exiting randomly with Linux OS
> status code -9 (most often) or -15 (also sometimes, but much more
> rarely). As far as I understand -9 corresponds to Bad file descriptor
> and -15 Block device required.
>
> 1) Is there a way h
On 4/14/2012 1:25 PM, vmars316 wrote:
> I installed portablePython(pP) here:
> C:\Users\vmars\Python3
> ?Does that look ok?
I would suggest including the minor version number (i.e. Python32
instead of Python3) because not all 3.x code is compatible with all
versions of Python 3.x - all code that w
On 4/15/2012 3:01 PM, Bryan wrote:
> I'd like to encourage my users to check out
> Python 3, but installing it on Windows will take over the '.py'
> extension and break stuff that currently works.
Have you tried telling your users to tell the installer not to do that?
IIRC, it's a simple checkbox o
On 4/15/2012 11:30 PM, vmars316 wrote:
> Isn't there a way just to doubleClick on myProg.py, to get it into the
> interpret/RUN?
Use the standard installer from python.org if you want to do things with
the registry. The standard installer sets up the registry for you so
that the interpreter will be
On 4/26/2012 6:37 AM, Kiuhnm wrote:
> Python has been "forked" into 2.x and 3.x because some breaking changes
> ought to be made to the language in order to improve it and clean it up.
That's not really a good way to put it. 2.6 and 2.7 will get security
fixes, but there won't be a 2.8 unless some
On 4/26/2012 8:02 AM, deuteros wrote:
> So how do I tell my IDE (Eclipse with PyDev) which version of Python I
> want to use?
When you start a new PyDev project, it will ask.
--
CPython 3.2.3/3.3.0a2 | Windows NT 6.1.7601.17790
--
http://mail.python.org/mailman/listinfo/python-list
On 4/28/2012 6:45 PM, Temia Eszteri wrote:
> Professional? He's boring!
I agree. Ranting Rick is much more entertaining (usually).
--
CPython 3.2.3/3.3.0a2 | Windows NT 6.1.7601.17790
--
http://mail.python.org/mailman/listinfo/python-list
Why wouldn't a for loop work? If something works, you can break out,
otherwise continue.
working_obj = None
for obj in iterable:
try:
obj.do_something()
working_obj = obj
break
except:
continue
--
CPython 3.3.0a3 | W
Forgot to add that all this is covered in the tutorial in the official docs:
http://docs.python.org/tutorial/controlflow.html#for-statements
--
CPython 3.3.0a3 | Windows NT 6.1.7601.17790
--
http://mail.python.org/mailman/listinfo/python-list
On 5/3/2012 7:36 PM, Peng Yu wrote:
> When convert two sets with the same elements to two lists, are the
> lists always going to be the same (i.e., the elements in each list are
> ordered the same)? Is it documented anywhere?
Sets are by definition unordered, so depending on their order would not
b
On 5/9/2012 4:25 PM, Alan Ristow wrote:
> Select the code block you want to indent and hit Tab. To do the reverse,
> hit Shift-Tab.
You can also select a code block and choose "Shift Right" or "Shift
Left" from the context menu.
--
CPython 3.3.0a3 | Windows NT 6.1.7601.17790
--
http://mail.pyth
On 5/17/2012 6:48 AM, Mark R Rivet wrote:
> I am in the process of learning python, and want to learn tkinter for
> GUI stuff. Is tkinter what people are using for GUI?
tkinter is one of several GUI toolkits that can be used with Python.
IIRC, most people use PyGTK or PyQt for serious projects.
ht
On 5/22/2012 6:44 PM, Gelonida N wrote:
> I'd like to install python 2.6 and 2.7 on Windows?
>
>
> In fact I have already 2.6 installed and would like to additionally
> install 2.7
>
>
>
> When clicking on .py file I'd like to execute it with python 2.6
There is an checkbox for an option to
On 5/23/2012 3:25 PM, Gelonida N wrote:
> So I just install 2.7 and uncheck this box and I'll keep 2.6 right?
Different versions are installed in different locations by default, and
if you uncheck that box, the installer will leave file associations alone.
--
CPython 3.3.0a3 | Windows NT 6.1.7601
On 5/24/2012 8:59 PM, Dave Angel wrote:
> so I fixed that, and got
> inconsistent use of tabs and spaces in indentation
>
> because you mistakenly used tabs for indentation.
Not to start another tabs-vs.-spaces discussion, but tabs are perfectly
legal indentation in Python. That exception is
On 5/30/2012 1:52 AM, ru...@yahoo.com wrote:
> Was there a reason for dropping the lexical processing of
> \u escapes in strings in python3 (other than to add another
> annoyance in a long list of python3 annoyances?)
To me, this would be a Python 2 annoyance since I would expect r'\u3000'
to be li
On 6/3/2012 5:01 PM, Janet Heath wrote:
> Thanks Alain. I should have a compiler on my Mac OS X Lion. I am thinking
> that it isn't set in my $PATH variable. I don't know where the $PATH is set
> at. I will check to see if their is a binary.
There are always Windows and OS X binary installers
On 6/6/2012 1:45 PM, MRAB wrote:
> On 06/06/2012 18:23, Jugurtha Hadjar wrote:
> [snip]
>> "range returns a « generator », convert it to list to see.." -->
>> "converts" instead of "convert".
>>
> No, "convert" is correct here; it's the imperative, i.e. "convert it to
> a list if you want to see.
On 6/10/2012 4:22 AM, Alexey Gaidamaka wrote:
> Practically the plugin is a simple html archive from python
> documentation website running
> inside Eclipse so you can call it using Eclipse help system.
> As for now it is pretty large (~7 mb), but i'm planning to optimize it
> in near future.
Rath
On 6/13/2012 1:17 AM, John Nagle wrote:
> What does "urllib2" want? Percent escapes? Punycode?
Looks like Punycode is the correct answer:
https://en.wikipedia.org/wiki/Internationalized_domain_name#ToASCII_and_ToUnicode
I haven't tried it, though.
--
CPython 3.3.0a3 | Windows NT 6.1.7601.17790
On 6/15/2012 11:31 PM, contro opinion wrote:
> is the /usr/lib/python-3.2.3/bin/python3 same as
> /usr/lib/python-3.2.3/bin/python3.2?
It should be. IIRC, ls -l will tell you if something is a link. You
could also run python3 and it will tell you the version.
--
CPython 3.3.0a4 | Windows NT 6.1.
On 6/17/2012 7:07 PM, Jon Clements wrote:
> I'm reminded of:
>
> http://xkcd.com/936/
> http://xkcd.com/792/
>
> There's also one where it's pointed out it's easier to brute force a
> person who has the code, than brute force the computer. [but can't find
> that one at the moment]
http://xkcd.
Perhaps this will clear things up:
Python 3.3.0a4 (v3.3.0a4:7c51388a3aa7, May 31 2012, 20:17:41) [MSC
v.1600 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> ua = u'a'
>>> literal_ua = "u'a'"
>>> ua == literal_ua
False
>>> input_ua = input()
u'a'
On 6/18/2012 11:32 AM, Jussi Piitulainen wrote:
> jmfauth writes:
>
>> Thinks are very clear to me. I wrote enough interactive
>> interpreters with all available toolkits for Windows
>
r = input()
> u'a
> Traceback (most recent call last):
> File "", line 1, in
> SyntaxError: u'a
>
> Er,
On 6/18/2012 12:03 PM, Dave Angel wrote:
> And you're missing the context. jmfauth thinks we should re-introduce
> the input/raw-input distinction so he could parse literal strings. So
> Jussi demonstrated that the 2.x input did NOT satisfy fmfauth's dreams.
You're right. I missed that part of jm
Are there any tools out there that will parse a script and tell me if it
is compatible with an arbitrary version of Python and highlight any
incompatibilities? I need to check a few of my scripts that target 3.2
to see if I can make them compatible with 3.0 and 3.1 if they aren't
already. I found p
On 2011.06.03 09:42 AM, Cathy James wrote:
> I need a jolt here with my python excercise, please somebody!! How can
> I make my functions work correctly? I tried below but I get the
> following error:
>
> if f_dict[capitalize]:
>
> KeyError:
>
...
>
> def capitalize (s):
> """capitalize accep
On 2011.06.09 12:18 PM, hisan wrote:
> Hi All,
>
> Please let me know which one is GOOD whether Python 2.6 OR 3.2.
> Please let me know the difference between them.
> Please give some refernce site or books to know the difference
I'm just a beginner, but AFAICT, there are three reasons to learn Pyt
On 2011.06.10 08:09 AM, KK wrote:
> I have python 3.2 installed m not able to install PyQt.
> i have downloaded and configured sip but how to build it???
The pages are misleading. You only need the SIP source if you want to
build everything from source. Since you don't seem to be familiar with
On 2011.06.11 04:41 AM, Asen Bozhilov wrote:
> Hi all,
> I am beginner in Python. What is interesting for me is that Python
> interpreter treats in different way dot and square bracket notations.
> I am coming from JavaScript where both notations lead prototype chain
> lookup.
>
> In Python it seem
I'm pretty happy that I can copy variables and their value from one
object's namespace to another object's namespace with the same variable
names automatically:
class simpleObject():
pass
a = simpleObject()
b = simpleObject()
a.val1 = 1
a.val2 = 2
b.__dict__.update(a.__dict__)
a.val1 = 'a'
On 2011.06.11 09:12 PM, Terry Reedy wrote:
> On 6/11/2011 9:32 PM, Andrew Berg wrote:
> > I'm pretty happy that I can copy variables and their value from one
>
> You are copying names and their associations, but not the objects or
> thier values.
Associations? The upd
On 2011.06.11 09:13 PM, Steven D'Aprano wrote:
> So never update from a random object you don't know well.
Of course. In the project I'm working on, this will be used in the
__init__() method of a class that accepts a pair of dictionaries or
possibly **kwargs (for flexibility and to avoid the very
On 2011.06.11 10:08 PM, Ian Kelly wrote:
> For immutable objects such as
> ints, this doesn't matter. For mutable objects such as lists, it can:
Well, that's confusing. How would I make actual copies?
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.06.11 10:40 PM, Ben Finney wrote:
> It's exactly the same as with an ordinary assignment (‘a = b’) in
> Python.
Fair enough.
> > How would I make actual copies?
> At what level?
Level? I just want to be able to create an object b with values from
dictionary a, and not have changes to a refl
On 2011.06.13 08:58 PM, Chris Angelico wrote:
> That's one of the reasons I like my laptop keyboard so much.
I find that the terribly tiny keys on a laptop keyboard make them very
evil. I don't see how anyone could type fast on one of them without
making tons of errors. I constantly have to fix typ
On 2011.06.14 07:18 PM, Chris Angelico wrote:
> There are many different designs of laptop keyboard. Tiny netbooks
> seem to have the very worst, leaving it nearly impossible to get any
> decent work done (there may be exceptions to that, but I've seen a lot
> of bad netbook keyboards). My current
On 2011.06.15 08:57 AM, Zach Dziura wrote:
> Just repeat this to yourself: Python ISN'T Java.
class MainClass:
def public static void main(*args):
print('Am I doin' it right?')
:P
Or something like that. I've forgotten almost everything I learned about
Java.
--
http://mail.python.org
On 2011.06.17 12:06 AM, John Salerno wrote:
> "On Windows, if dst already exists, OSError will be raised even if it
> is a file.."
If you try to create a file or directory that already exists on Windows,
you'll get a WindowsError with error code 183:
>>> os.mkdir('C:\\common\\games')
Traceback (mos
On 2011.06.22 10:45 AM, Chetan Harjani wrote:
> why tuples are immutable whereas list are mutable?
Tuples are more efficient and more appropriate for a list of items that
doesn't need to change.
> why when we do x=y where y is a list and then change a element in x, y
> changes too( but the same is
On 2011.06.23 06:24 PM, miamia wrote:
> Hello,
> I am using 32bit win xp pro and compiling my python scripts as exe
> with py2exe. Everything works ok on 32bit windows platforms. But how
> can I compile my program for use on 64bit Windows?
>
> On 64bit windows this error occures in event log:
> Act
On 2011.06.24 03:48 AM, Duncan Booth wrote:
> http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script
Heh. On Windows 7, using 'runas' for the operation in os.startfile()
gives me a normal UAC prompt.
Is there any way to ask for elevation from a subprocess.Popen
On 2011.06.24 03:48 AM, Duncan Booth wrote:
> http://stackoverflow.com/questions/130763/request-uac-elevation-from-within-a-python-script
Heh. On Windows 7, using 'runas' for the operation in os.startfile()
gives me a normal UAC prompt.
Is there any way to ask for elevation from a subprocess.Popen
On 2011.06.27 02:05 AM, Amaninder Singh wrote:
> Hi,
> I am fairly new to python, I am trying to write simple code and It is
> giving me syntax error. I am reading a book and following the
> directions as it says in the book but I am not sure why it is not
> working.
Looks like the book you're read
On 2011.06.26 03:57 PM, Gelonida wrote:
> The reason I am asking is, that I'd like to create a directory structure
> where multiple users should be allowed to read / write / create files
> and directories.
This may not require pywin32 - by default there's a public directory at
os.environ['public'
I'm working on an audio/video converter script (moving from bash to
Python for some extra functionality), and part of it is chaining the
audio decoder (FFmpeg) either into SoX to change the volume and then to
the Nero AAC encoder or directly into the Nero encoder. This is the
chunk of code from my
On 2011.06.28 01:32 AM, Peter Otten wrote:
> >>> subprocess.call(["ls"], stdout=open(os.devnull, "w"))
> 0
D'oh! Not sure why I was thinking os.devnull was a file object. :-[
> Start with factoring out common code into a good old function.
For some reason I was thinking I would have problems doing
On 2011.06.28 02:44 AM, Thomas Rachel wrote:
> The way you work with the exception is not the very best - instead of
> parsing the stringified exception, you better would trigger on
> exc.winerror (it is an integer with the error number).
>
> Or, even better, just pas the error information contai
I didn't get at least two messages from the "call a function every 10
seconds thread", and possibly some other messages, and I access the
group via the mailing list. I use the latest stable Thunderbird, if that
matters. I've only noticed this recently, and I'm still getting other
messages. In fact,
On 2011.06.29 03:53 PM, Noah Hall wrote:
> I think the more likely answer is that it was sent without being also
> sent to python-list.
Possible, but they were two messages from two different people and
happened within a few hours of each other, so it could be that the two
messages didn't go throug
I forgot to mention I don't have Usenet access, and Google Groups'
archives don't have messages from the last couple of days, so I can't
check the Usenet side.
--
http://mail.python.org/mailman/listinfo/python-list
Okay, so I've refactored those except WindowsError blocks into calls to
a function and fixed the os.devnull bug, but I still can't get the
triple chain working. I added calls to ffmpeg_proc.stdout.close() and
sox_proc.stdout.close(), but I really am not sure where to put them. The
following code wo
On 2011.07.01 02:26 AM, Peter Otten wrote:
> I can't reproduce your setup, but I'd try using communicate() instead of
> wait() and close().
I don't really know what communicate() does. The docs don't give much
info or any examples (that explain communicate() anyway), and don't say
when communicate
This code is working:
> try:
> ffmpeg_proc = subprocess.Popen(queue[position].ffmpeg_cmd,
> stdout=subprocess.PIPE, stderr=open(os.devnull, 'w'))
> except WindowsError as exc:
> log_windows_error(exc, queue[position].ffmpeg_cmd, 'critical')
> break
> if queue[pos
On 2011.07.05 01:14 PM, sal migondis wrote:
> How could a belief be wrong?
Beliefs aren't subjective. One's taste in music, for example, is
largely subjective and can't be right or wrong, but a belief (which has
to do with facts) certainly can be.
> > > What do you think will be the eventual outco
On 2011.07.05 10:20 AM, Chris Angelico wrote:
> You, sir, have a warped and twisted mind.
>
> And I love it!!
>
> Now to secretly put code into some module somewhere and wait for
> people to start tearing their hair out wait, did I say that out
> loud?
from pytroll import print
--
http://mail.
On 2011.07.05 09:31 PM, Chris Angelico wrote:
> I've said for a while that Microsoft could do far worse than to turn
> Windows into a GUI that sits on top of a Unix-derived kernel. They
> won't do it, though, because it would be tantamount to admitting both
> that Unix is superior to Windows, AND t
On 2011.07.05 11:25 PM, Chris Angelico wrote:
> Suppose I gave you a computer that had GNOME ported to Windows, and
> used the purplish palette that Ubuntu 10.10 uses, and had a Windows
> port of bash as its most convenient terminal. Members of this list
> will doubtless have no problem duck-typing
On 2011.07.06 12:03 AM, Dan Stromberg wrote:
> I disagree. The stuff endusers tend to use is polished to some
> extent, but the backend is verging on hideous. If a developer
> complains about the ugly internal structure "yeah, but you say that
> just because you're a computer person / geek."
Admi
On 2011.07.06 12:26 AM, Dennis Lee Bieber wrote:
> On Tue, 05 Jul 2011 16:01:57 -0500, Andrew Berg
> declaimed the following in
> gmane.comp.python.general:
>
> > On 2011.07.05 01:14 PM, sal migondis wrote:
> > > How could a belief be wrong?
> > Beliefs aren
On 2011.07.06 11:11 AM, Steven D'Aprano wrote:
> The Dead Window Sketch
> ==
As much as I hate it when people feed trolls, that was pretty funny.
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.07.06 01:19 PM, rantingrick wrote:
> ##
> The Roman Stawman Sketch
> ##
Nice try, but you have to use a Monty Python sketch (and you have to
spell correctly :-P ).
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.07.06 12:38 PM, Phlip wrote:
> Python sucks. m = md5() looks like an initial assignment, not a
> special magic storage mode. Principle of least surprise fail, and
> principle of most helpful default behavior fail.
func() = whatever the function returns
func = the function object itself (in
On 2011.07.06 02:07 PM, Phlip wrote:
> If I call m = md5() twice, I expect two objects.
You get two objects because you make the function run again. Of course,
the first one is garbage collected if it doesn't have another reference.
>>> m1 = hashlib.md5()
>>> m2 = hashlib.md5()
>>> m1 is m2
False
On 2011.07.06 06:16 PM, Steven D'Aprano wrote:
> Phlip wrote:
>
> > Note the fix also avoids comparing to None, which, as usual, is also
> > icky and less typesafe!
>
> "Typesafe"? Are you trying to make a joke?
Maybe he has a duck phobia. Maybe he denies the existence of ducks.
Maybe he doesn't li
On 2011.07.07 08:11 AM, Phlip wrote:
> No, I was pointing out that passing a type is more ... typesafe.
None is a type.
>>> None.__class__
--
http://mail.python.org/mailman/listinfo/python-list
On 2011.07.07 08:39 AM, Phlip wrote:
> On Jul 7, 6:24 am, Andrew Berg wrote:
> > On 2011.07.07 08:11 AM, Phlip wrote:> No, I was pointing out that passing a
> > type is more ... typesafe.
> >
> > None is a type.
>
> I never said it wasn't.
You
On 2011.07.07 10:21 AM, António Rocha wrote:
> I'm running Python (32b) in Windows7 (at 64bits) and I would like to
> know how can I check if my machine is a 32b or 64b in Python. Is it
> possible? I saw a few examples (like platform) but they only provide
> information about Python not the machine
On 2011.07.07 12:22 PM, Martin Schöön wrote:
> I just found the following url in my archives at work and
> thought you might enjoy it:
> http://thc.org/root/phun/unmaintain.html
That's awesome.
> If a maintenance programmer can't quote entire Monty Python movies
> from memory, he or she has *no* b
On 2011.07.07 08:46 PM, Steven D'Aprano wrote:
> None is not a type, it is an instance.
>
> >>> isinstance(None, type) # is None a type?
> False
> >>> isinstance(None, type(None)) # is None an instance of None's type?
> True
>
> So None is not itself a type, although it *has* a type:
>
> >>> type
On 2011.07.07 12:29 PM, rantingrick wrote:
> So you prefer to close a gazillion windows one by one? If so, why not
> just code the GUI correctly from the start; by creating separate
> transactions? Thereby reducing the number of windows a user must
> juggle? FYI: You know the user complexity of a G
Is it bad practice to use this
> logger.error(self.preset_file + ' could not be stored - ' +
> sys.exc_info()[1])
Instead of this?
> logger.error('{file} could not be stored -
> {error}'.format(file=self.preset_file, error=sys.exc_info()[1]))
Other than the case where a variable isn't a string (f
On 2011.07.08 05:59 PM, Ben Finney wrote:
> With the caveat that the formatting of that line should be using PEP 8
> indentation for clarity:
PEP 8 isn't bad, but I don't agree with everything in it. Certain lines
look good in chunks, some don't, at least to me. It's quite likely I'm
going to be wr
On 2011.07.09 06:06 AM, Vinay Sajip wrote:
> In a logging context at least, using the form like
>
> logger.debug("formatting message with %s", "arguments")
>
> rather than
>
> logger.debug("formatting message with %s" % "arguments")
How would I do that with the newer formatting? I've tried:
> logge
On 2011.07.09 07:26 PM, John Salerno wrote:
> I have a script that does some stuff that I want to run every day for
> maybe a week, or a month. So far I've been good about running it every
> night, but is there some way (using Python, of course) that I can make
> it automatically run at a set time
On 2011.07.09 08:32 PM, Bruce Whealton wrote:
> Hello,
> So, I got this book on Programming the Semantic Web about
> the same time I started learning Python. The code seems to be
> developed for python 2.7 and not 3, I believe.
If you're going to learn Python 3, I suggest learning from
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote:
> "file" is a built-in (related to "open").
It is? What is it?
>>> type(file)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'file' is not defined
I don't see it in
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
On 2011.07.09 09:54 PM, Dennis Lee Bieber wrote:
> "file" is a built-in (related to "open").
Also:
> Traceback (most recent call last): File
> "C:\Users\Bahamut\workspace\Disillusion\disillusion.py", line 178, in
> save_preset() File
> "C:\Users\
-BEGIN PGP SIGNED MESSAGE-
Hash: RIPEMD160
On 2011.07.09 11:04 PM, Andrew Berg wrote:
>
> Is barf built-in as well?
>
That came off more hostile than I wanted, so I'll rephrase it:
I doubt it has anything to do with built-ins, since it fails on a
variable name that obvi
101 - 200 of 397 matches
Mail list logo