Professional IronPython



Download 20,35 Mb.
Pdf ko'rish
bet263/453
Sana01.07.2022
Hajmi20,35 Mb.
#723045
1   ...   259   260   261   262   263   264   265   266   ...   453
250

CHAPTER 12
Debugging ironPython APPlicAtions
FIgURE 12-5: 
Use formatwarning() to see how your warning will appear.
Of course, it’s handy to know the arguments for the 
formatwarning()
function. The following list 
provides a brief description of each argument.
➤➤
Message: The message you want to display to the user.


Category: The warning category you want to use.


Filename: The name of the file where the warning occurred (not necessarily the current file).


Line number: In most cases, this value contains the line at which the warning is detected, which 
isn’t always the line at which the warning occurs. For example, it’s possible for a warning to 
appear at the end of a structure, rather than at the appropriate line within the structure.


Line of code: An optional entry that shows the line of code at which the warning occurs. 
If you don’t supply this argument, the 
formatwarnings()
function defaults to a value of 
None
. The IronPython implementation differs from the standard in this regard. According 
to the standard, the interpreter is supposed to read the file, obtain the correct line of code, 
and display the specified line when you don’t provide the appropriate text.
Working with Categories
A warning category is a means of identifying a particular kind of warning. The category makes it pos-
sible to group like warnings together and reduces the risk that someone will misinterpret the meaning 
of a message. In short, a category is a way to pigeonhole a particular message so that others know 
what you intend. Of course, filtering considers the warning category, so you also need to use the cor-
rect category to ensure filtering works as expected. Table 12-3 contains a list of the warning message 
categories, including a general 
Warning
class that you shouldn’t ever use because it’s too general.

Download 20,35 Mb.

Do'stlaringiz bilan baham:
1   ...   259   260   261   262   263   264   265   266   ...   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