TGTGInsightтелеграм анализLIVE / telegram public index
← Такты, стеки, два колеса

TGINSIGHT SIMILAR POSTS

Намери подобно съдържание

Изходен канал @clockstackwheels · Post #444 · 11.07

Вы наверняка знаете о проекте "Кибердеревня" от творческой группы Birchpunk. У них же есть совместная песня с петрозаводским рэпером Albatross, где главный герой читает из будущего о войне с машинами. Там звучат такие строчки: You will never see a normal sidewalk indeed But every moron has a phone with FaceID Он рассуждает о том, что человечество использует технологии неправильно: раз техническое развитие позволяет буквально каждому дураку иметь hi-end устройство с крутыми функциями, почему мы не можем сделать в городах нормальные тротуары? Online cameras watch the hood, delivery droids carry the food But my babushka* has to go to hospital on foot We use technology for something wrong If you're indifferent, why robots should be strong? Я и задумался: а правда, почему так получается? Человечество достигло невероятных высот в обслуживании индивидуума. У нас с вами в домах висят экраны на всю стену и стоят процессоры из нанометрового кремния, выполняющие по триллиону операций в секунду с данными на другом конце планеты. Роботы стирают, убирают и моют посуду, некоторым людям лечат технологиями полную глухоту, стабилизируют электроникой сердцебиение. Мы используем топовые материалы для вещей вокруг нас и для производства одежды, беговые кроссовки могут стоить несколько тысяч долларов и вовлекать совокупный труд тысячи человек. Как получилось, что цивилизация с таким развитием допускает на улицах мусор и разбитый асфальт? Почему у нас так плохо решены социальные проблемы? Почему бывают бомжи и алкоголики? Почему существует грязь и упадок в отдельных местах? Можно подумать, что люди не готовы платить за общее, а готовы только за личное, но я не верю в это. Я вот готов платить, и, думаю, таких много. Но почему-то экономика работает здесь странным образом: обычная квартира может стоить, например, 10 миллионов рублей, а абсолютно такая же квартира в жилом комплексе с хорошим двором уже 20 миллионов. Как так выходит? Если с каждой из тысячи квартир собрать по 10 миллионов сверху, получится 10 миллиардов — неужели двор столько стоит? Я уверен, что даже с учётом распилов и откатов нет, и можно сделать на два порядка дешевле. Вообще очень многие места по моим наблюдениям можно улучшить небольшими силами. Но заплатить эти деньги не предлагают, видимо, считают, что люди платить не станут. Если так, то почему? Где развитие общества пошло не так? Как мы, человечество, вообще дошли до такой сильной разницы между индивидуальным и общим? #life * автор использует смесь русского и английского в песне, говорит с умышленно выраженным акцентом, а ещё ведёт для англоговорящих людей обучающие видеоролики по разговорному русскому, поэтому применяет известный в англоязычном мире термин babushka вместо grandma.

Hashtags

Резултати

Намерени 5 подобни публикации

Търсене: #staticmethod

当前筛选 #staticmethod清除筛选
djangoproject

@djangoproject · Post #593 · 13.04.2018 г., 19:48

@#classmethod vs @#staticmethod vs "plain" methods What's the difference? class MyClass: def method(self): """ Instance methods need a class instance and can access the instance through self. """ return 'instance method called', self @classmethod def classmethod(cls): """ Class methods don't need a class instance. They can't access the instance (self) but they have access to the class itself via cls. """ return 'class method called', cls @staticmethod def staticmethod(): """ Static methods don't have access to cls or self. They work like regular functions but belong to the class's namespace. """ return 'static method called' # All methods types can be # called on a class instance: »> obj = MyClass() »> obj.method() ('instance method called', <MyClass instance at 0x1019381b8>) »> obj.classmethod() ('class method called', <class MyClass at 0x101a2f4c8>) »> obj.staticmethod() 'static method called' # Calling instance methods fails # if we only have the class object: »> MyClass.classmethod() ('class method called', <class MyClass at 0x101a2f4c8>) »> MyClass.staticmethod() 'static method called' »> MyClass.method() TypeError: "unbound method method() must be called with MyClass " "instance as first argument (got nothing instead)"

djangoproject

@djangoproject · Post #385 · 15.07.2017 г., 16:17

# @classmethod vs @staticmethod vs "plain" methods # What's the difference? class MyClass: def method(self): """ Instance methods need a class instance and can access the instance through self. """ return 'instance method called', self @classmethod def classmethod(cls): """ Class methods don't need a class instance. They can't access the instance (self) but they have access to the class itself via cls. """ return 'class method called', cls @staticmethod def staticmethod(): """ Static methods don't have access to cls or self. They work like regular functions but belong to the class's namespace. """ return 'static method called' # All methods types can be # called on a class instance: »> obj = MyClass() »> obj.method() ('instance method called', <MyClass instance at 0x1019381b8>) »> obj.classmethod() ('class method called', <class MyClass at 0x101a2f4c8>) »> obj.staticmethod() 'static method called' # Calling instance methods fails # if we only have the class object: »> MyClass.classmethod() ('class method called', <class MyClass at 0x101a2f4c8>) »> MyClass.staticmethod() 'static method called' »> MyClass.method() TypeError: "unbound method method() must be called with MyClass " "instance as first argument (got nothing instead)" #classmethod#staticmethod

djangoproject

@djangoproject · Post #87 · 11.07.2016 г., 11:53

https://docs.python.org/3/library/functions.html#staticmethod #staticmethod(function) Return a #static method for function. A static method does not receive an implicit first argument. To declare a static method, use this idiom: class C: @staticmethod def f(arg1, arg2, ...): ... The @staticmethod form is a function decorator – see the description of function definitions in Function definitions for details. It can be called either on the class (such as C.f()) or on an instance (such as C().f()). The instance is ignored except for its class. Static methods in Python are similar to those found in Java or C++. Also see classmethod() for a variant that is useful for creating alternate class constructors. For more information on static methods, consult the documentation on the standard type hierarchy in The standard type hierarchy. class str(object='') class str(object=b'', encoding='utf-8', errors='strict') Return a str version of object. See str() for details. str is the built-in string class. For general information about strings, see Text Sequence Type — str.