Re: what is the difference between tuple and list?

2006-05-16 Thread Diez B. Roggisch
daniel wrote: is there any typical usage that shows their difference? d = {} d[('multi', 'part', 'key')] = 'schnarz' d[['multi', 'part', 'key']] = 'schnarz' Traceback (most recent call last): File stdin, line 1, in ? TypeError: list objects are unhashable A lot of discussions regarding

Re: what is the difference between tuple and list?

2006-05-16 Thread Simon Brunning
On 16 May 2006 07:47:24 -0700, daniel [EMAIL PROTECTED] wrote: http://www.python.org/doc/faq/general.html#why-are-there-separate-tuple-and-list-data-types -- Cheers, Simon B, [EMAIL PROTECTED], http://www.brunningonline.net/simon/blog/ -- http://mail.python.org/mailman/listinfo/python-list

Re: what is the difference between tuple and list?

2006-05-16 Thread infidel
is there any typical usage that shows their difference? I think the general idea is to use lists for homogenous collections and tuples for heterogenous structures. I think the database API provides a good usage that shows their differences. When you do cursor.fetchall() after executing a

Re: what is the difference between tuple and list?

2006-05-16 Thread Harold Fellermann
The main difference is that lists are mutables while tuples are not. Tuples are fine if you only want to group some objects (e.g. as a return value) and access their members as in t = (1,2,3,4) t[2] 3 Lists give you a lot more flexibility, because they are mutable: you can change the order of

Re: what is the difference between tuple and list?

2006-05-16 Thread daniel
thank you all for replying, I'm new to python, and just reading the python tutorial now. I did not expect the FAQ to contain any relevant topics, so thanks Simon... your comments did make sense, I should have read the tutorial more thoroughly, It's not a good question, I admit. ;-) English is

Re: what is the difference between tuple and list?

2006-05-16 Thread bruno at modulix
infidel wrote: is there any typical usage that shows their difference? I think the general idea is to use lists for homogenous collections and tuples for heterogenous structures. I think the database API provides a good usage that shows their differences. When you do cursor.fetchall()

Difference between threading.local and protecting data with locks

2006-05-01 Thread juxstapose
Hello, I have been develop a blocking socket application with threading. The main thread handles connections and inserts them into python's protected queue as jobs for the thread pool to handle. There is not much information on threading.local except that it states that in maintains variable

Re: difference between class and static methods?

2006-04-19 Thread Petr Prikryl
John Salerno wrote... [...] So a class method is specifically for using the class name itself as an object in the method? If that's the case, then it makes some sense now. I guess the reason I didn't get it before is that this is a feature of dynamic languages, right? And something that

difference between class and static methods?

2006-04-18 Thread John Salerno
I've been reading up on them, but I don't quite understand how they differ in practice. I know how each is implemented, and from C# I already know what a static method is. But I won't assume that it's the same in Python. And on top of that, both the class and static methods of Python seem to

Re: difference between class and static methods?

2006-04-18 Thread Marc 'BlackJack' Rintsch
In [EMAIL PROTECTED], John Salerno wrote: I've been reading up on them, but I don't quite understand how they differ in practice. I know how each is implemented, and from C# I already know what a static method is. But I won't assume that it's the same in Python. And on top of that, both

Re: difference between class and static methods?

2006-04-18 Thread John Salerno
Marc 'BlackJack' Rintsch wrote: If you call `B.from_file('spam.xyz')` now, the `from_file()` method inherited from class `A` is called but with `B` as the first argument so it returns an instance of `B`. A staticmethod is just a function attached to a class without any magic. So a class

Re: Difference between 'is' and '=='

2006-04-03 Thread Adam DePrince
On Mon, 2006-03-27 at 17:17 -0500, Terry Reedy wrote: Clemens Hepper [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's strange: python seem to cache constants from 0 to 99: The Python specification allows but does not require such behind-the-scenes implementation

Re: Difference between 'is' and '=='

2006-04-03 Thread Roy Smith
Adam DePrince [EMAIL PROTECTED] wrote: It just happens that the logical operation (a is b ) - (a == b ) is always True. Only for small values of always. You can always do pathological things with operators: class Foo: def __eq__ (self, other): return False f = Foo() print f

Re: Difference between 'is' and '=='

2006-04-03 Thread Dave Hansen
On 3 Apr 2006 10:37:11 -0400 in comp.lang.python, [EMAIL PROTECTED] (Roy Smith) wrote: Adam DePrince [EMAIL PROTECTED] wrote: It just happens that the logical operation (a is b ) - (a == b ) is always True. Only for small values of always. You can always do pathological things with

Re: Difference between 'is' and '=='

2006-04-03 Thread Jon Ribbens
In article [EMAIL PROTECTED], Roy Smith wrote: This may even be useful. What if you were trying to emulate SQL's NULL? NULL compares false to anything, even itself. Strictly speaking, comparing NULL to anything gives NULL, not False. -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-04-03 Thread Duncan Booth
Adam DePrince wrote: It just happens that the logical operation (a is b ) - (a == b ) is always True. That is incorrect: inf = 1e300*1e300 nan = inf-inf nan is nan, nan==nan (True, False) -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-29 Thread Joel Hedlund
There's no requirement that the socket module or anything else return values using the same object that the socket.AF_UNIX constant uses. Ouch. That's certainly an eyeopener. For me, this means several things, and I'd really like to hear people's thoughts about them. It basically boils down

Re: Difference between 'is' and '=='

2006-03-29 Thread Fredrik Lundh
Joel Hedlund wrote: For me, this means several things, and I'd really like to hear people's thoughts about them. It basically boils down to don't ever use 'is' unless pushed into a corner, and nevermind what PEP8 says about it. nonsense. Identity checks can only be done safely to compare

Re: Difference between 'is' and '=='

2006-03-29 Thread Joel Hedlund
sorry You compare a module.CONSTANT to the result of an expression s/an expression/a binary operation/ /joel Joel Hedlund wrote: If it weren't for the current CPython optimization (caching small integers) This has already been covered elsewhere in this thread. Read up on it. this

Re: Difference between 'is' and '=='

2006-03-29 Thread Max M
Joel Hedlund wrote: There's no requirement that the socket module or anything else return values using the same object that the socket.AF_UNIX constant uses. Ouch. That's certainly an eyeopener. For me, this means several things, and I'd really like to hear people's thoughts about

Re: Difference between 'is' and '=='

2006-03-29 Thread Joel Hedlund
For me, this means several things, and I'd really like to hear people's thoughts about them. you need to spend more time relaxing, and less time making up arbitrary rules for others to follow. I'm very relaxed, thank you. I do not make up rules for others to follow. I ask for other peoples

Re: Difference between 'is' and '=='

2006-03-29 Thread Duncan Booth
Joel Hedlund wrote: It basically boils down to don't ever use 'is' unless pushed into a corner, and nevermind what PEP8 says about it. A quick grep[*] of the Python library shows the following common use-cases for 'is'. The library isn't usually a good indicator of current style though: a

Re: Difference between 'is' and '=='

2006-03-29 Thread Joel Hedlund
[*] I discovered a neat feature I didn't know my editor had: grepping for [c:python-keywordis Neat indeed. Which editor is that? Thanks for a quick and comprehensive answer, btw. Cheers! /Joel -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-29 Thread Duncan Booth
Joel Hedlund wrote: [*] I discovered a neat feature I didn't know my editor had: grepping for [c:python-keywordis Neat indeed. Which editor is that? Epsilon from www.lugaru.com. The drawback is that it costs real money although you can try the beta for the next version until it is

difference between .cgi and .py

2006-03-29 Thread amaltasb
Hi, I am new to python.. I have uploaded few scripts in my cgi-bin folder, some with extension .cgi and some with .py. What is the difference between the two extensions.. which one is more prefered, do it effects performance ?? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: difference between .cgi and .py

2006-03-29 Thread Sybren Stuvel
[EMAIL PROTECTED] enlightened us with: I am new to python.. I have uploaded few scripts in my cgi-bin folder, some with extension .cgi and some with .py. What is the difference between the two extensions.. None at all, except the way you write them. which one is more prefered That depends

Re: difference between .cgi and .py

2006-03-29 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Hi, I am new to python.. I have uploaded few scripts in my cgi-bin folder, some with extension .cgi and some with .py. Only how the Web server is configured. What is the difference between the two extensions.. which one is more prefered, do it effects performance

Re: Difference between 'is' and '=='

2006-03-28 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 23:02 -0800, alex23 escreveu: Felipe Almeida Lessa wrote: I said [constants defined in your code] can (maybe should?) be used with is, and AFAICT I'm right as well: b = a b is a True You should _never_ use 'is' to check for equivalence of value. Yes, due

Re: Difference between 'is' and '=='

2006-03-28 Thread Joel Hedlund
This does *not* also mean constants and such: snip a = 123456789 a == 123456789 True a is 123456789 False I didn't mean that kind of constant. I meant named constants with defined meaning, as in the example that I cooked up in my post. More examples: os.R_OK,

Re: Difference between 'is' and '=='

2006-03-28 Thread Joel Hedlund
You should _never_ use 'is' to check for equivalence of value. Yes, due to the implementation of CPython the behaviour you quote above does occur, but it doesn't mean quite what you seem to think it does. /me not checking for value. I'm checking for identity. Suppose a is a constant. I want

Re: Difference between 'is' and '=='

2006-03-28 Thread Joel Hedlund
Not those kind of constants, but this one: Python 2.4.2 (#2, Nov 20 2005, 17:04:48) [GCC 4.0.3 2005 (prerelease) (Debian 4.0.2-4)] on linux2 Type help, copyright, credits or license for more information. CONST = 123456789 a = CONST a == CONST True a is CONST True That's a little

Re: Difference between 'is' and '=='

2006-03-28 Thread Joel Hedlund
a is None is quicker than a == None I think it's not such a good idea to focus on speed gains here, since they really are marginal (max 2 seconds total after 1000 comparisons): import timeit print timeit.Timer(a == None, a = 1).timeit(int(1e7)) 4.19580316544 print

Re: Difference between 'is' and '=='

2006-03-28 Thread Peter Hansen
Joel Hedlund wrote: This does *not* also mean constants and such: snip a = 123456789 a == 123456789 True a is 123456789 False I didn't mean that kind of constant. I meant named constants with defined meaning, as in the example that I cooked up in my post. More

Re: Difference between 'is' and '=='

2006-03-28 Thread Steven D'Aprano
On Tue, 28 Mar 2006 12:12:52 +0200, Joel Hedlund wrote: I try to stay away from speed microoptimisations as much as possible since it generally results in less readable code, which in turn often results in an overall speed loss because code maintenance will be harder. +1 QOTW -- Steven.

Re: Difference between 'is' and '=='

2006-03-28 Thread Ross Ridge
Felipe Almeida Lessa wrote: That said, you can do thinks like: import socket a = socket.AF_UNIX a is socket.AF_UNIX True That kind of constants can be used with is. But if don't want to be prone to errors as I do, use is only when you really know for sure that you're dealing with

Re: Difference between 'is' and '=='

2006-03-28 Thread Felipe Almeida Lessa
Em Ter, 2006-03-28 às 15:18 -0800, Ross Ridge escreveu: [snip] Consider this example using the socket.IPPROTO_RAW constant: socket.getaddrinfo(localhost, None, socket.AF_INET, socket.SOCK_RAW, socket.IPPROTO_RAW)[0][2] is socket.IPPROTO_RAW False socket.getaddrinfo(localhost, None,

Re: Difference between 'is' and '=='

2006-03-28 Thread Joel Hedlund
If it weren't for the current CPython optimization (caching small integers) This has already been covered elsewhere in this thread. Read up on it. this code which it appears you would support writing if (flags os.R_OK) is os.R_OK: I do not. You compare a module.CONSTANT to the

Difference between 'is' and '=='

2006-03-27 Thread mwql
Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-27 Thread Rene Pijlman
mwql: Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? http://docs.python.org/ref/comparisons.html -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-27 Thread Max M
mwql wrote: Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? is is like id(obj1) == id(obj2) 100+1 == 101 True 100+1 is 101 False They don't have the same id. (Think of id as

Re: Difference between 'is' and '=='

2006-03-27 Thread Fuzzyman
mwql wrote: Hey guys, this maybe a stupid question, but I can't seem to find the result anywhere online. When is the right time to use 'is' and when should we use '=='? Thanks alot~ '==' is the equality operator. It is used to test if two objects are 'equal'. 'is' is the identity operator,

Re: Difference between 'is' and '=='

2006-03-27 Thread Joel Hedlund
is is like id(obj1) == id(obj2) snip (Think of id as memory adresses.) Which means that is comparisons in general will be faster than == comparisons. According to PEP8 (python programming style guidelines) you should use 'is' when comparing to singletons like None. I take this to also include

Re: Difference between 'is' and '=='

2006-03-27 Thread Roy Smith
In article [EMAIL PROTECTED], Joel Hedlund [EMAIL PROTECTED] wrote: Which means that is comparisons in general will be faster than == comparisons. I thought that == automatically compared identify before trying to compare the values. Or am I thinking of some special case, like strings? --

Re: Difference between 'is' and '=='

2006-03-27 Thread Peter Hansen
Roy Smith wrote: In article [EMAIL PROTECTED], Joel Hedlund [EMAIL PROTECTED] wrote: Which means that is comparisons in general will be faster than == comparisons. I thought that == automatically compared identify before trying to compare the values. Or am I thinking of some special

Re: Difference between 'is' and '=='

2006-03-27 Thread Clemens Hepper
Roy Smith wrote: In article [EMAIL PROTECTED], Joel Hedlund [EMAIL PROTECTED] wrote: Which means that is comparisons in general will be faster than == comparisons. I thought that == automatically compared identify before trying to compare the values. Or am I thinking of some special

Re: Difference between 'is' and '=='

2006-03-27 Thread Dan Sommers
On Mon, 27 Mar 2006 14:52:46 +0200, Joel Hedlund [EMAIL PROTECTED] wrote: ... According to PEP8 (python programming style guidelines) you should use 'is' when comparing to singletons like None. I take this to also include constants and such ... This does *not* also mean constants and such:

Re: Difference between 'is' and '=='

2006-03-27 Thread mwql
It's really strange, if a = 1 b = 1 a is b == True the same thing applies for strings, but not for dict, lists or tuples I think the 'is' operator is useful for objects only, not for primitive types, I think I solved the mystery behind my bugged code =) --

Re: Difference between 'is' and '=='

2006-03-27 Thread Benji York
mwql wrote: It's really strange, if a = 1 b = 1 a is b == True the same thing applies for strings Not quite: 'abc' is 'abc' True 'abc' is 'ab' + 'c' False -- Benji York -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between 'is' and '=='

2006-03-27 Thread Clemens Hepper
Dan Sommers wrote: This does *not* also mean constants and such: Python 2.4.2 (#1, Feb 22 2006, 08:02:53) [GCC 4.0.1 (Apple Computer, Inc. build 5247)] on darwin Type help, copyright, credits or license for more information. a = 123456789 a == 123456789 True

Re: Difference between 'is' and '=='

2006-03-27 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 08:23 -0500, Dan Sommers escreveu: On Mon, 27 Mar 2006 14:52:46 +0200, Joel Hedlund [EMAIL PROTECTED] wrote: ... According to PEP8 (python programming style guidelines) you should use 'is' when comparing to singletons like None. I take this to also include constants

Re: Difference between 'is' and '=='

2006-03-27 Thread Diez B. Roggisch
mwql wrote: It's really strange, if a = 1 b = 1 a is b == True the same thing applies for strings, but not for dict, lists or tuples I think the 'is' operator is useful for objects only, not for primitive types, I think I solved the mystery behind my bugged code =) The reason that

Re: Difference between 'is' and '=='

2006-03-27 Thread filipwasilewski
Clemens Hepper wrote: It's strange: python seem to cache constants from 0 to 99: That's true. The Python api doc says that Python keeps an array of integer objects for all integers between -1 and 100. See http://docs.python.org/api/intObjects.html. This also seems to be true for integers from -5

Re: Difference between 'is' and '=='

2006-03-27 Thread Donn Cave
In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: ... So - your conclusion is basically right: use is on (complex) objects, not on numbers and strings and other built-ins. The exception from the rule is None - that should only exist once, so foo is not None is

Re: Difference between 'is' and '=='

2006-03-27 Thread Terry Reedy
Clemens Hepper [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] It's strange: python seem to cache constants from 0 to 99: The Python specification allows but does not require such behind-the-scenes implementation optimization hacks. As released, CPython 2.4 caches -5 to 99, I

Re: Difference between 'is' and '=='

2006-03-27 Thread Erik Max Francis
Terry Reedy wrote: The Python specification allows but does not require such behind-the-scenes implementation optimization hacks. As released, CPython 2.4 caches -5 to 99, I believe. In 2.5, the upper limit was increased to 256. The limits are in a pair of #define statements in the int

Re: Difference between 'is' and '=='

2006-03-27 Thread Rene Pijlman
Terry Reedy: The Python specification allows but does not require such behind-the-scenes implementation optimization hacks. As released, CPython 2.4 caches -5 to 99, I believe. In 2.5, the upper limit was increased to 256. The limits are in a pair of #define statements in the int object

Re: Difference between 'is' and '=='

2006-03-27 Thread Dan Sommers
On Mon, 27 Mar 2006 11:08:36 -0300, Felipe Almeida Lessa [EMAIL PROTECTED] wrote: Em Seg, 2006-03-27 às 08:23 -0500, Dan Sommers escreveu: On Mon, 27 Mar 2006 14:52:46 +0200, Joel Hedlund [EMAIL PROTECTED] wrote: ... According to PEP8 (python programming style guidelines) you should use

Re: Difference between 'is' and '=='

2006-03-27 Thread Felipe Almeida Lessa
Em Seg, 2006-03-27 às 21:05 -0500, Dan Sommers escreveu: Right off the top of my head, I can't think of a way to make a = b; a is b return False. Sorry for being so --quiet. I will try to be more --verbose. I can think of two types of constants: 1) Those defined in the language, like True,

Re: Difference between 'is' and '=='

2006-03-27 Thread alex23
Felipe Almeida Lessa wrote: I said [constants defined in your code] can (maybe should?) be used with is, and AFAICT I'm right as well: b = a b is a True You should _never_ use 'is' to check for equivalence of value. Yes, due to the implementation of CPython the behaviour you quote above

Re: Difference between 'is' and '=='

2006-03-27 Thread Antoon Pardon
Op 2006-03-27, Donn Cave schreef [EMAIL PROTECTED]: In article [EMAIL PROTECTED], Diez B. Roggisch [EMAIL PROTECTED] wrote: ... So - your conclusion is basically right: use is on (complex) objects, not on numbers and strings and other built-ins. The exception from the rule is None - that

Difference between a library and a module...

2006-03-07 Thread sophie_newbie
OK this might seem like a retarded question, but what is the difference between a library and a module? If I do: import string am I importing a module or a library? And if i do string.replace() am I using a module or a function or a method or what? Sorry. -- http://mail.python.org/mailman

Re: Difference between a library and a module...

2006-03-07 Thread [EMAIL PROTECTED]
intro to OOP, for a better understanding, but the main difference between a function and a method, is that a method is associated with some class or object. In Python it's really only objects (even class is an object) Hence when I created the string object foo, and executed Capitalize

Re: Difference between a library and a module...

2006-03-07 Thread Laszlo Zsolt Nagy
sophie_newbie wrote: OK this might seem like a retarded question, but what is the difference between a library and a module? If I do: import string am I importing a module or a library? I'm not a guru, but... I think that modules are things that live inside the Python language

Re: Difference between a library and a module...

2006-03-07 Thread bruno at modulix
sophie_newbie wrote: OK this might seem like a retarded question, Better to look like an ignorant than to stay one !-) but what is the difference between a library and a module? Python only defines 'modules' and 'packages'. A module can technically be any python source file, but usually

Re: Difference between a library and a module...

2006-03-07 Thread Bruno Desthuilliers
Laszlo Zsolt Nagy a écrit : sophie_newbie wrote: OK this might seem like a retarded question, but what is the difference between a library and a module? If I do: import string am I importing a module or a library? I'm not a guru, but... I think that modules are things that live

Re: Difference between a library and a module...

2006-03-07 Thread Bruno Desthuilliers
built from a function. Read some intro to OOP, for a better understanding, but the main difference between a function and a method, is that a method is associated with some class or object. Note that (part of) this association is made at runtime. Before you try to access it, it's a function

Re: Difference between CPython, Python for .NET and IronPython?

2006-02-20 Thread Ian Bicking
Claudio Grondi wrote: I have asked similar 'question' some weeks ago in the German Python newsgroup. It seems, that that Pythonistas have generally not much interest in IronPython waiting for at least release 2.0 of it which is _perhaps_ expected to support Mono. My understanding is that

Difference between CPython, Python for .NET and IronPython?

2006-02-18 Thread Carl Johan Rehn
What is the difference between CPython, Python for .NET, and IronPython? For example, if I'm running IronPython, can I access modules such as Numeric and numarray? As I understand it, interoperability with C# and .NET works in both directions with IronPython, but CPython modules cannot

Re: Difference between CPython, Python for .NET and IronPython?

2006-02-18 Thread Claudio Grondi
Carl Johan Rehn wrote: What is the difference between CPython, Python for .NET, and IronPython? For example, if I'm running IronPython, can I access modules such as Numeric and numarray? As I understand it, interoperability with C# and .NET works in both directions with IronPython

Re: Difference between CPython, Python for .NET and IronPython?

2006-02-18 Thread Diez B. Roggisch
For example, if I'm running IronPython, can I access modules such as Numeric and numarray? AFAIK not. You can run pure python modules, but not extensions containing native code. As I understand it, interoperability with C# and .NET works in both directions with IronPython, but CPython

Re: Difference between ActivePython and Python.org

2005-12-19 Thread Peter A.Schott
Amen to this one. Found out this after struggling with no SSL module when trying to write some secure FTP and HTTPS code. Downloaded the version from Python.org and it worked like a champ. I believe you can get both and have no issues with the install, though. For my part, I decided to

Re: The difference between import package.module and from package import module(about pymol)

2005-12-16 Thread Ben Finney
Xiao Jianfeng [EMAIL PROTECTED] writes: In pymol I can use from chempy import Atom but import chempy.Atom doesn't work. It says,ImportError: No module named Atom. What is going wrong ? I would trust the error message first, and check your assumption. Is 'chempy' actually a package, containing

The difference between import package.module and from package import module(about pymol)

2005-12-15 Thread Xiao Jianfeng
Hello, In pymol I can use from chempy import Atom but import chempy.Atom doesn't work. It says,ImportError: No module named Atom. What is going wrong ? Thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Daniel Crespo
Good question, I have the same anxiety. Thanks Daniel -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Rudy Schockaert
Activestate just bundles teh standard python with the pywin32 module of Mark Hammond and provides the documentation in a handy one-file CHM format.Besides that there is no difference as far as I know. On 12/14/05, S.Chang [EMAIL PROTECTED] wrote: Hi,Anyone knows the difference(s) between the

Re: Difference between ActivePython and Python.org

2005-12-14 Thread BartlebyScrivener
I fretted about which to pick and have advised here that the difference (if any) should be explained on the Python.org download page. I chose ActiveState because I'm on Windows XP, which means that the Win32 Extensions get installed automatically, along with other goodies (the PythonWin IDE, a

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Alan Franzoni
S.Chang on comp.lang.python said: Hi, Anyone knows the difference(s) between the Python binaries from ActiveState and Python.org? ActivePython is a 'batteries included' distro. I think it's great for Windows - it includes a lot of manuals in CHM format and the Win32 extensions. The

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Steve Christensen
On 2005-12-14, S.Chang [EMAIL PROTECTED] wrote: Hi, Anyone knows the difference(s) between the Python binaries from ActiveState and Python.org? If you want to re-distribute the ActivePython packages outside of your organization, you have to get permission from ActiveState.

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Neil Hodgson
S.Chang: Anyone knows the difference(s) between the Python binaries from ActiveState and Python.org? As well as the differences mentioned by others, ActivePython does not include SSL (Secure Socket Layer) and thus HTTPS support. It would be helpful if the ActivePython What's Included

Re: Difference between ActivePython and Python.org

2005-12-14 Thread Trent Mick
[S.Chang wrote] Anyone knows the difference(s) between the Python binaries from ActiveState and Python.org? The responses to this thread so far gave most of the differences. In summary: - On Windows, ActivePython includes the PyWin32 extensions. - ActivePython rolls the core Python docs and a

Re: What's the difference between VAR and _VAR_?

2005-09-10 Thread Michael Ekstrand
On 8 Sep 2005 22:48:05 -0700 Johnny Lee [EMAIL PROTECTED] wrote: I thought there must be something special when you named a VAR with '_' the first character. Maybe it's just a programming style and I had thought too much... It is just a programming style issue. In Python, variables and

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread EP
I thought there must be something special when you named a VAR with '_' the first character. Maybe it's just a programming style and I had thought too much... Perhaps you are thinking of the use of double leading underscore names within class declarations or system defined names with

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread S. D. Rose
I can't get the value of the variable (out of the class function) if it has two leading underscores. -Dave class encrypt: def encrypt(self, userValue): self.initialNumber = userValue self.__secretSeed = 7 return self.initialNumber * self.__secretSeed enc = encrypt() enc.encrypt(5) 35

Re: What's the difference between VAR and _VAR_?

2005-09-09 Thread Erik Max Francis
S. D. Rose wrote: I can't get the value of the variable (out of the class function) if it has two leading underscores. Sure you can if you want it hard enough; it's just mangled. class C: __x = 1 ... dir(C) ['_C__x', '__doc__', '__module__'] c = C() dir(c) ['_C__x', '__doc__',

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
As what you said, the following two code section is totally the same? (I) class TestResult: _passxxx_ = pass (II) class TestResult: passxxx = pass -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Erik Max Francis
Johnny Lee wrote: As what you said, the following two code section is totally the same? (I) class TestResult: _passxxx_ = pass (II) class TestResult: passxxx = pass No, of course not. One defines a class varaible named `_passxxx_', the other defines one named

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
Erik Max Francis wrote: No, of course not. One defines a class varaible named `_passxxx_', the other defines one named `passsxxx'. I mean besides the difference of name... -- http://mail.python.org/mailman/listinfo/python-list

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Erik Max Francis
Johnny Lee wrote: I mean besides the difference of name... You're going to have to be more clear; I don't understand your question. What's the difference between a = 1 and b = 1 besides the difference of name? -- Erik Max Francis [EMAIL PROTECTED] http

Re: What's the difference between VAR and _VAR_?

2005-09-08 Thread Johnny Lee
Erik Max Francis wrote: You're going to have to be more clear; I don't understand your question. What's the difference between a = 1 and b = 1 besides the difference of name? I thought there must be something special when you named a VAR with '_' the first character

Re: What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Diez B. Roggisch
Johnny wrote: Hi, I wonder what is the difference between the built-in function getattr() and the normal call of a function of a class. Here is the details: getattr( object, name[, default]) Return the value of the named attributed of object. name must be a string. If the string

Re: What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Johnny
Diez B. Roggisch wrote: No, it will only return _always_ a value if you provide a default one. If not, they have the exact same semantics. What you've got here is something usually called syntactic sugaring - a specialized syntax that performs certain instructions that _could_ be done by

Re: What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Robert Kern
Johnny wrote: Hi, I wonder what is the difference between the built-in function getattr() and the normal call of a function of a class. Here is the details: getattr( object, name[, default]) Return the value of the named attributed of object. name must be a string. If the string

What's the difference between built-in func getattr() and normal call of a func of a class

2005-08-23 Thread Johnny
Hi, I wonder what is the difference between the built-in function getattr() and the normal call of a function of a class. Here is the details: getattr( object, name[, default]) Return the value of the named attributed of object. name must be a string. If the string is the name of one

what's the difference between *.dll and *.pyd if both of them are extended python module?

2005-08-23 Thread wen
. what's the difference between them? i saw the code is same as common c++ extended python module, can i use microsoft visual C++ to create a dll project for compiling it as _cmd.dll? 2. i have never written a module with extension *.pyd, how to make a *.pyd? and, i doubt, how the author debug

Re: what's the difference between *.dll and *.pyd if both of them are extended python module?

2005-08-23 Thread Daniel Dittmar
wen wrote: 1. what's the difference between them? i saw the code is same as common c++ extended python module, can i use microsoft visual C++ to create a dll project for compiling it as _cmd.dll? .pyd is just a naming convention. It was probably introduced to prevent name clashes

Re: Difference between and '

2005-07-23 Thread Steven D'Aprano
On Fri, 22 Jul 2005 08:38:28 -0400, Peter Hansen wrote: Steven D'Aprano wrote: It may shock some people to learn that difference in the sense of mathematical subtraction is not the only meaning of the word, but there it is. One wouldn't, I hope, misunderstand What is the difference

Re: Difference between and '

2005-07-22 Thread Michael Hoffman
Steven D'Aprano wrote: Michael Hoffman wrote: John Machin wrote: [EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? ord(') - ord('') 5 Very zen. But unfortunately incorrect, since the original poster didn't ask for the difference

Re: Difference between and '

2005-07-22 Thread John Machin
[EMAIL PROTECTED] wrote: Hi, Can someone tell me the difference between single quote and double quote? ord(') - ord('') 5 or ask a meaningful question ... -- http://mail.python.org/mailman/listinfo/python-list

Re: Difference between and '

2005-07-22 Thread Erik Max Francis
[EMAIL PROTECTED] wrote: Can someone tell me the difference between single quote and double quote? One has double the fun. -- Erik Max Francis [EMAIL PROTECTED] http://www.alcyone.com/max/ San Jose, CA, USA 37 20 N 121 53 W AIM erikmaxfrancis Forgive your enemies, but never forget

Re: Difference between and '

2005-07-22 Thread Peter Hansen
Steven D'Aprano wrote: It may shock some people to learn that difference in the sense of mathematical subtraction is not the only meaning of the word, but there it is. One wouldn't, I hope, misunderstand What is the difference between spaghetti marinara and spaghetti pescatora? and attempt

<    4   5   6   7   8   9   10   >