@djangoproject · Post #155 · 04.09.2016 г., 12:23
https://anthony-zhang.me/blog/python-bound-methods/ when & why we use @#staticmethod
Hashtags
TGINSIGHT SIMILAR POSTS
Изворен канал @cryptoattack · Post #20249 · 30 ное.
🎧Главное за сегодня: 🗽Хроники#BTC#ETH#ETF: - Grayscale представила поправки к Трастовому соглашению #GBTC - Hashdex встретились с SEC - SEC подтвердила заявку на спот ETH-ETF 🔥#BTC MicroStrategy приобрела 16 130 BTC 🏦#BNB Binance запустили пилотную программу банковского хранения залога 🇬🇧#HOOD Robinhood снова пробует запуститься в Великобритании 🇮🇳#ALGO Фонд Algorand расширяет свое присутствие в Индии 🇧🇷 Бразилия введет 15% налог на криптодоходы, хранящиеся на оффшорных биржах 🇰🇿 Canaan возобновляет добычу #BTC в Казахстане 🇧🇷#GLMR Moonbeam, DUX и Grupo RÃO запустили программу лояльности Web3 в Бразилии 🇦🇪 Fasset получили лицензию VASP в Дубае 🇺🇸#макроСША: - PCE Price index (окт): - м/м: 0% (пред: +0.4%) - г/г: +3% (пред +3.4%); - Initial Jobless Claims: 218 тыс (пред 209 тыс) 🏴☠#KNC Хакер KyberSwap хочет получить полный контроль над протоколом 🆕 UPBIT листит#ID🚀 💰#HOOK Hooked запустит экосистемный фонд на 50 млн $ 🏴☠Взломан горячий кошелёк Nobitex 🙋♂#ARB RARI запустил L2 RARI Chain на Arbitrum 🥳#SXP Solar Banking и Solar Card готовы к тестированию 🦾 AntPool возместит рекордную комиссию в размере 3 млн $ в #BTC 🙋♂ CoinList открыл регистрацию для BitsCrunch 🙅♂#WHITE Whiteheart закрывается 🔄#INJ Injective скоро выпустит "крупнейшее обновление" основной сети 🥳#FOREзапустили свою платформу прогнозирования 📱#GAL Мобильное приложение Galxe доступно на Android и TestFlight 🥳#COTIзапустили COTI Foundation 🙋♂#YFI#MAIC Yearn v3 запущена на Polygon 👀#STORJанонсировали Storj Select 🥳#DATA Streamr принят в программу запуска Web3 Google Cloud 🤝Партнёрства: - #ACH Alchemy Pay запартнёрились с SEPA🚀 - #ALGO Algorand запартнёрились с ПРООН и URECA🇲🇳 - #UNI Uniswap Labs запартнёрились с Talos - #MNT#GAL Galxe сотрудничает с Mantle - #EURSсотрудничает с Stellar #XLM - #QUICK#MANTA QuickSwap интегрирует Steer Protocol (Manta Pacific) - #NEARзапартнёрились с #PYTH #CPOOL#OKB#OKT Web3 Wallet OKX интегрирован с Clearpool - #SEIзапустили Bug Bounty Program в партнерстве с Immunefi - #LINK SAO запартнёрились с Chainlink 🕵♂Активность китов и SmartMoney: - На Coinbase заводят#BTC на сотни млн $ - новый кошелёк накопил 10 796 #BTC - 100 000 #ETHвывели с Coincheck и 30 000 #ETHвывели с BitDao - Cumberland перевели 1,8 млн #OP на CEX - кит выводит свою крипту с Binance - команда #HOOKзаводит токены на Binance - кошельки выводят#ID с бирж для подготовки к депозиту на Upbit - мультиподписной адрес участника #MEMEперевел на новый адрес 1,034 млрд MEME - ARK закупает акции Robinhood #HOOD и продаёт #COIN 📊Графики: - топ-100 кошельков #TUSDпродали 28% своих холдингов - киты активно накапливают#MATIC🐳 - более 75% игр Web3 оказались неудачными🎮 - ТОП проектов по росту TVL в ноябре 💰Сборы средств: - #POKTGrove - 7,9 млн $ - MITH - 3,5 млн $ ✏️События на завтра: 🔓 Разлок: 1inch (#1INCH) - 9,48% of Circ.Supply ($35,52m) - Hedera (#HBAR) - 0,54% of M.Cap ($11,51m) - SKALE (#SKL) - 2,81% of M.Cap ($6,65m) - Vulcan Forged (#PYR) - 0,84% of M.Cap ($1,34m) - Aurory (#AURY) - 1,63% of M.Cap ($1,11m) - Solend (#SLND) - 6% of M.Cap ($1,99m) - StakeWise (#SWISE) - 4,87% of M.Cap ($1,51m) - Immutable (#IMX) - 2,94% of M.Cap ($50,68m) - Hooked (#HOOK) - 27,07% of M.Cap ($15,53m) - Acala (#ACA) - 3,31% of Circ.Supply ($1,62m) - Dydx (#DYDX) - 81.63% of Cir. Supply ($505.5M) 🥳 Arbitrum (#ARB) финальный клейм NFT Arbitrum Odyssey 🥳 Radiant Capital (#RDNT) готовит анонс (или 3 декабря) 🔛 Obol Network - Запуск открытой бета-версии основной сети - UBXS (#UBXS) - Запуск рынка недвижимости Bixos 🔄 BNB Chain (#BNB) - Хард-форк 🧯 Ternoa (#CAPS) - Сжигание токенов - SaitaRealty (#SRLTY) - Сжигание токенов - Platform of meme coins (#PAYU) - Сжигание токенов 🍿#ETH#BTCПятничная экспирация 🔁 Medibloc (#MED) - Миграция токенов 🇩🇪 Manufacturing (PMI) (нояб) - 11:55мск 🇪🇺 Manufacturing (PMI) (нояб) - 12:00мск 🇬🇧 Manufacturing (PMI) (нояб) - 12:30мск 🇺🇸 Manufacturing (PMI) (нояб) - 16:45мск - ISM Manufacturing (PMI) (нояб) - 17:00мск - Выступление главы ФРС Пауэлла - 19:00мск
Пребарај: #staticmethod
@djangoproject · Post #155 · 04.09.2016 г., 12:23
https://anthony-zhang.me/blog/python-bound-methods/ when & why we use @#staticmethod
Hashtags
@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)"
Hashtags
@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
Hashtags
@djangoproject · Post #126 · 31.08.2016 г., 02:13
goo.gl/QkvD2L #staticmethod #Classmethod
Hashtags
@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.
Hashtags