On 7 Jan., 23:06, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
> > can someone quickly tell me what the encoding of __file__ is? I can't
> > find it in the documentation.
>
> > BTW, I'm using Python 2.5.1 on WIndows XP and Vista.
>
> It's platform-specific - the same encoding that is used for file
Dear all,
can someone quickly tell me what the encoding of __file__ is? I can't
find it in the documentation.
BTW, I'm using Python 2.5.1 on WIndows XP and Vista.
Kind regards,
Sebastian
--
http://mail.python.org/mailman/listinfo/python-list
Well, you see, I have some database functions that deal with "things"
which are either classes or instances thereof. I though polymorphism
would be a nice way to handle them identically, like:
def do(thing): thing.Foo()
do(t)
do(Test)
But never mind, I now understand that Test.__dict__ can contai
Dear fellow Pythonians,
I just stumbled upon the following unexpected behavior:
class TestType(type):
def Foo(self): return 'TestType Foo'
class Test(object):
__metaclass__ = TestType
def Foo(self): return 'Test Foo'
t = Test()
print t.Foo()
print Test.Foo()
This will produce:
Test F
Thanks.
--
http://mail.python.org/mailman/listinfo/python-list
Folks,
I'm running into the following issue. A staticmethod of a class seems
not to be accepted as a special class method of the class object
itself. For example:
class Foo(object):
def __len__(): return 2
__len__ = staticmethod(__len__)
print len(Foo)
>>>
Traceback (most recent c