Shithon 3

Jul. 23rd, 2021 08:39 pm
[personal profile] ex0_planet
Г-ди, как же хорошо что второй питон сдох:
class Foo: pass
class Bar: pass
f,b=Foo(),Bar()

type(f)==type(b)
>> True

type(f),type(b)
>> (instance, instance)


Однако
class Foo(object): pass
class Bar(object): pass
f,b=Foo(),Bar()

type(f)==type(b)
>> False

type(f),type(b)
>> (__main__.Foo, __main__.Bar)


В третьей версии уже последний вариант, безальтернативно.

Date: 2021-07-23 07:56 pm (UTC)
juan_gandhi: (Default)
From: [personal profile] juan_gandhi

Ну, неплохой прогресс.

Profile

ex0_planet

April 2023

S M T W T F S
      1
234567 8
910111213 1415
16171819202122
23242526272829
30      

Most Popular Tags

Page Summary

Style Credit

Expand Cut Tags

No cut tags
Page generated Apr. 26th, 2026 01:48 am
Powered by Dreamwidth Studios