Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet257/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   253   254   255   256   257   258   259   260   ...   453
TAblE 12-1: 
Warning-Related Functions and Their Purpose
FUNCTIoN 
PURPoSE
filterwarnings() 
Adds rules to a warning that affects when it triggers and how the inter-
preter reacts to the warning.
formatwarning() 
Displays a warning in the standard way.
548592c12.indd 242
2/24/10 12:48:44 PM
www.finebook.ir


Understanding IronPython Warnings
 

 
243
FUNCTIoN 
PURPoSE
resetwarnings() 
Resets the warning state to its default settings.
showwarning() 
Displays the specified warning. You can use this function to write
the warning to a file. The function defaults to writing the warning
to the 
sys.stderr
device.
simplefilter() 
Provides a simplified version of the 
filterwarnings()
function that 
doesn’t require the use of Regular Expressions.
warn() 
Used to issue a warning of a particular category.
warn_explicit() 
Provides low-level access to the 
warn()
function so that you can out-
put extended warning information.
warnpy3k() 
Issues warnings for Python 3.x–related deprecations. This function 
doesn’t do anything unless you start IronPython using the 
–3
command 
line switch.
This chapter doesn’t describe every argument you can use with every function; 
it concentrates on actual usage instead. The site at 
http://docs.python.org/
library/warnings.html
 provides information about all of the arguments you 
can use with each of these functions.
Working with Actions
Before you do too much with warnings, it’s important to know that warnings have an action associated 
with them. For example, you can choose to turn a particular warning into an exception or to ignore it 
completely. You can apply actions to warnings in a number of ways using either the 
filterwarnings()
or 
simplefilter()
function. Table 12-2 shows the list of standard warning actions.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   253   254   255   256   257   258   259   260   ...   453




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish