En Sat, 09 Jan 2010 13:11:28 -0300, Victor Subervi
victorsube...@gmail.com escribió:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single
value. I
need to treat it differently depending on which it is. How can
Victor Subervi wrote:
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron
gher...@islandtraining.com mailto:gher...@islandtraining.com wrote:
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable
On Mon, Jan 11, 2010 at 10:00 AM, Jean-Michel Pichavant
jeanmic...@sequans.com wrote:
Victor Subervi wrote:
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron
gher...@islandtraining.commailto:
gher...@islandtraining.com wrote:
Victor Subervi wrote:
Hi;
I have a string.join
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single value. I
need to treat it differently depending on which it is. How can I distinguish
it? len(var) will obviously give me the length of the string if it's a
string
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single
value. I need to treat it differently depending on which it is. How can
I distinguish it? len(var) will obviously give me the length of
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single
value. I need to treat it differently depending on which it is. How
can I distinguish it? len(var) will obviously give me the length of
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single value. I
need to treat it differently depending on which it is. How can I distinguish
it? len(var) will obviously give me the length of the
On Sat, Jan 9, 2010 at 11:56 AM, Gary Herron gher...@islandtraining.comwrote:
Victor Subervi wrote:
Hi;
I have a string.join statement on a variable that comes from a
cgi.FieldStorage().getlist. The variable may be a list or a single value. I
need to treat it differently depending on which
In article [EMAIL PROTECTED],
Steven Bethard [EMAIL PROTECTED] wrote:
Erik Johnson wrote:
Erick [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Ah, you're running into the old-style classes vs. new style classes.
Try subclassing from object.
For example:
class
Just wrote:
In article [EMAIL PROTECTED],
Steven Bethard [EMAIL PROTECTED] wrote:
py class A:
... pass
...
py class B:
... pass
...
py a = A()
py a.__class__ == A
True
py a.__class__ == B
False
Uh, isinstance(a, A) works for both new-style and old-style classes.
Heck, isinstance() even
Erik Johnson wrote:
Steven Bethard [EMAIL PROTECTED] wrote:
py class A:
... pass
...
py class B:
... pass
...
py a = A()
py a.__class__ == A
True
py a.__class__ == B
False
Just [EMAIL PROTECTED] wrote
Uh, isinstance(a, A) works for both new-style and old-style classes.
Heck, isinstance()
Erik Johnson wrote:
As an aside, I notice a lot of other people's interpreters actually
print 'True' or 'False' where my system prints 0 or 1. Is that a
configuration that can easily set somewhere?
$ python2.1 -c print 1 == 1
1
$ python2.2 -c print 1 == 1
1
$ python2.3 -c print 1 == 1
I quickly browsed through section 9 of the Tutorial, tried some simple
Google searches: I'm not readily seeing how to test class type. Given some
object (might be an instance of a user-created class, might be None, might
be list, might be some other standard type object instance), how do you
On Erik Johnson wrote:
# The following works, but I don't want to keep a set of instances to
compare against
obj2 = A()
type(obj) == type(obj2)
1
How about:
class A:
pass
class B:
pass
objA = A()
type( objA ) == type( A() )
True
then again
objB = B()
type( objA
Ah, you're running into the old-style classes vs. new style classes.
Try subclassing from object.
For example:
class A(object):
... pass
...
a=A()
type(a)
class '__main__.A'
type(a) == A
True
type(a) is A
True
b=A()
type(a) == type(b)
True
type(a) is type(b)
True
Check out the
15 matches
Mail list logo