<?xml version="1.0" encoding="utf-8" ?><!-- generator="bbPress" -->

<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
>

<channel>
<title>Програмиране с Python</title>
<link>http://oldfmi.py-bg.net/forums/</link>
<description>Последни 35 отговора във форумите на курса Програмиране с Python</description>
<language>en</language>
<pubDate>Fri, 27 Sep 2013 19:08:59 +0000</pubDate>

<item>
<title>alive on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1344</link>
<pubDate>Wed, 21 May 2008 15:28:10 +0000</pubDate>
<dc:creator>alive</dc:creator>
<guid isPermaLink="false">1344@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;</description>
</item>
<item>
<title>wireman on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1342</link>
<pubDate>Wed, 21 May 2008 10:16:35 +0000</pubDate>
<dc:creator>wireman</dc:creator>
<guid isPermaLink="false">1342@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;SlayerX, в този тест ние &#60;strong&#62;ти подаваме&#60;/strong&#62; &#60;code&#62;0&#60;/code&#62; като знаменател. &#60;code&#62;assertRaises()&#60;/code&#62; работи по следния начин:&#60;/p&#62;
&#60;ol&#62;
&#60;li&#62;Давате му като първи аргумент изключението, което искате да се уверите, че ще бъде хвърлено.&#60;/li&#62;
&#60;li&#62;Като втори аргумент му давате &#60;code&#62;callable&#60;/code&#62;-а, който да бъде извикан.&#60;/li&#62;
&#60;li&#62;Останалите подадени на &#60;code&#62;assertRaises()&#60;/code&#62; аргументи се подават на &#60;code&#62;callable&#60;/code&#62;-a.&#60;/li&#62;
&#60;/ol&#62;
&#60;p&#62;Последното е необходимо, за да може &#60;code&#62;assertRaises()&#60;/code&#62; да бъде дефинирано като нещо от сорта:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;def assertRaises(expected_exception, tested_callable, *args):
  try:
    tested_callable(*args)
  except expected_exception:
    pass
  else:
    raise expected_exception + &#38;quot; not raised.&#38;quot;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;С други думи, вика се &#60;code&#62;self.user.rational(0, 0)&#60;/code&#62; и се проверява дали това хвърля &#60;code&#62;ValueError&#60;/code&#62;, както трябва да бъде според условието. В твоя случай, &#60;code&#62;self.user.rational(0, 0)&#60;/code&#62; не хвърля това изключение, понеже в &#60;code&#62;__init__()&#60;/code&#62; няма</description>
</item>
<item>
<title>SlayerX on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1341</link>
<pubDate>Wed, 21 May 2008 09:45:31 +0000</pubDate>
<dc:creator>SlayerX</dc:creator>
<guid isPermaLink="false">1341@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;self.assertRaises(ValueError, self.user.rational, 0, 0)&#60;/p&#62;
&#60;p&#62;Е тук нямам ValueError. По default, rational ми е (0,1), а вие не ми давате 0 като знаменател.&#60;br /&#62;
Другата ми гре</description>
</item>
<item>
<title>wireman on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1338</link>
<pubDate>Tue, 20 May 2008 23:29:02 +0000</pubDate>
<dc:creator>wireman</dc:creator>
<guid isPermaLink="false">1338@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;Kirov, alive &#38;mdash; нали се сещате колко трябва да се внимава за такива гре</description>
</item>
<item>
<title>alive on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1335</link>
<pubDate>Tue, 20 May 2008 22:40:00 +0000</pubDate>
<dc:creator>alive</dc:creator>
<guid isPermaLink="false">1335@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;направил съм една доста глупава гре</description>
</item>
<item>
<title>packo on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1334</link>
<pubDate>Tue, 20 May 2008 21:35:34 +0000</pubDate>
<dc:creator>packo</dc:creator>
<guid isPermaLink="false">1334@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;ОК. Схванах. Нищо следващия път повече :Р
&#60;/p&#62;</description>
</item>
<item>
<title>Kirov on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1333</link>
<pubDate>Tue, 20 May 2008 21:35:26 +0000</pubDate>
<dc:creator>Kirov</dc:creator>
<guid isPermaLink="false">1333@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;Аз може ли да помоля да ми прегледате пак задачата, защото си импортвам една функция, която при теста не се импортва и съответно гърми.&#60;br /&#62;
61133
&#60;/p&#62;</description>
</item>
<item>
<title>wireman on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1332</link>
<pubDate>Tue, 20 May 2008 21:21:09 +0000</pubDate>
<dc:creator>wireman</dc:creator>
<guid isPermaLink="false">1332@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;packo, проблемът е в начина, по който си дефинирал методите &#60;code&#62;__eq__&#60;/code&#62;, &#60;code&#62;__ne__&#60;/code&#62; и сходните &#38;mdash; доста са омазани, а &#60;code&#62;assertEqual()&#60;/code&#62; всъщност ползва оператора &#60;code&#62;==&#60;/code&#62;, за да сравнява двата подадени му &#60;code&#62;rational()&#60;/code&#62;-а.
&#60;/p&#62;</description>
</item>
<item>
<title>iavoriankov on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1330</link>
<pubDate>Tue, 20 May 2008 21:01:43 +0000</pubDate>
<dc:creator>iavoriankov</dc:creator>
<guid isPermaLink="false">1330@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;Мен пък ме е яд - отрицателните степени направо повдигам вместо да обърна дробта и получавам приближени резултати ...
&#60;/p&#62;</description>
</item>
<item>
<title>packo on "Въпросче за 5-та задачка"</title>
<link>http://oldfmi.py-bg.net/forums/topic/170#post-1329</link>
<pubDate>Tue, 20 May 2008 20:31:07 +0000</pubDate>
<dc:creator>packo</dc:creator>
<guid isPermaLink="false">1329@http://oldfmi.py-bg.net/forums/</guid>
<description>&#60;p&#62;&#34;Traceback (most recent call last):&#60;/p&#62;
&#60;p&#62;  File &#34;.../test.py&#34;, line 39, in test_operations&#60;/p&#62;
&#60;p&#62;    self.assertEqual(self.user.rational(3, 4) * 2, self.user.rational(3, 2))&#60;/p&#62;
&#60;p&#62;AssertionError: (3, 2) != (3, 2)&#60;/p&#62;
&#60;p&#62;======================================================================&#60;/p&#62;
&#60;p&#62;FAIL: test_operations_simple (tester.ProblemTests)&#60;/p&#62;
&#60;p&#62;----------------------------------------------------------------------&#60;/p&#62;
&#60;p&#62;Traceback (most recent call last):&#60;/p&#62;
&#60;p&#62;  File &#34;.../test.py&#34;, line 23, in test_operations_simple&#60;/p&#62;
&#60;p&#62;    self.assertEqual(self.user.rational(3, 4), self.user.rational(1, 4) + self.user.rational(1, 2))&#60;/p&#62;
&#60;p&#62;AssertionError: (3, 4) != (3, 4)&#34;&#60;br /&#62;
Това някакъв майтап ли е?????
&#60;/p&#62;</description>
</item>

</channel>
</rss>
