LoginSignup
0
0

More than 1 year has passed since last update.

ガラス器具取り扱いの横道

Posted at

ガラス器具の取り扱い

TDとTC

体積を正確に測るガラス器具には二つの種類があります。
皆さんが想像しやすいピペットなどのToDeliverと
想像しにくいメスフラスコなどのToContainの二つです。

TDについて

除算演算子(割り算)の右側にTDの器具があるとおかしいです。
TDの器具はある一塊の液体から一部を量り取る器具だからです。
ですのでPythonのdunderメソッドのrtruedivを不活性化しておきます。
コードは以下の通りです

DisableRTD.py
    def __rtruediv__(self, other) -> None:
        warnings.warn('''"To Deliver" Glassware library is to pick solution up.\n
                        This operator is disabled. Find another way.''')

###TCについて
乗算演算子(掛け算)の右側にTCの器具があるとおかしいです。
TCの器具はある一塊の液体を測られた量に薄める器具だからです。
ですのでPythonのdunderメソッドのrmulを不活性化しておきます。

DisableRMul.py
    def __rmul__(self, other) -> None:
        warnings.warn('''"To Contain" Glassware library is to diffuse solution.\n
                        This operator is disabled. Find another way.''')

これでインテリセンスに警告が出ればいいですが、またの機会に検証しましょう。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0