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

TGINSIGHT SIMILAR POSTS

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

Изходен канал @clockstackwheels · Post #270 · 25.03

Apple всё-таки отключает русские карты от Apple Pay, в том числе "Мир". Когда я несколько дней назад писал о смене платёжного приложения, я думал, что они уже отключили, и поиронизировал тогда над пользователями яблок. Но вы меня поправили, "Мир" действительно работали в Apple Pay внутри страны. А теперь вот, получается, и правда отключили. Конкретно это решение компании Apple такое же истерически-конформистское, как и решения других западных компаний. Google вон вообще сразу русские карты в Google Pay выключил. Но я хочу всё-таки заострить внимание на запрете со стороны Apple использовать на айфонах любые другие платёжные приложения, кроме Apple Pay. Этот запрет не распространялся конкретно на Россию и не введён недавно, это просто часть общей идеологии компании: мы лучше знаем, как причинить тебе добро. Это всё ради твоей же безопасности (знакомая риторика, кстати?). Закрытость проявляется и в других вещах: не так то просто поставить на айфоне стороннее приложение не из магазина, не так то просто получить доступ к файловой системе. Именно эту привязку к своей экосистеме, а значит и возможность диктовать свои условия, я отмечал в своём давнем выпуске подкаста с рассказом о том, почему перешёл с iPhone на Android ещё в прошлом году. Глобально, конечно, мы от монополий никуда не уйдём, а у компаний всегда будет возможность навязывать свою идеологию под угрозой отключения каких-то услуг или сервисов. Sony даже нарушили собственную Terms Of Service, чтобы отключить русскоязычные аккаунты от PS Store (в том числе в Армении, Грузии, Казахстане, Сингапуре и т.д.). Власть монополий это, пожалуй, одна из главных проблем капитализма, и антимонопольные меры, принятые в большинстве стран, по факту с этим справляются очень плохо. Но там, где есть выбор, стоит всё-таки стараться выбирать максимально независимые решения. Конечно, у них будут проблемы. Как правило независимые решения сложнее в настройке и обращении, чем предварительно разжёванные корпорацией. А ещё вы можете думать, что совершенно точно всю жизнь собираетесь разделять идеологию и решения вашей любимой корпорации (такая религиозность, кстати, нередко свойственна как раз фанатам Apple). Тут мне вспоминается сюжет из 1984, когда у главного героя коллега, совершенно преданный системе, всё равно попал в тюрьму, потому что был слишком умён, а, значит, представлял для системы угрозу. Фантасты, кстати, нередко пророчат корпорациям превращение в государства в будущем. По мне так очень вероятный сценарий. Граница между политикой и крупнейшим бизнесом уже сейчас максимально размыта. #life#gadgets

Резултати

Намерени 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.