Re: Review request: python bindings for libiscsi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> It is a lot more code, and notice how the libiscsi_auth_info struct
> contains a 
> method field and an union, currently there is only chap support, but
> in the 
> future there will also be radius and who knows which other methods.
> The way you 
> propose lies madness when the "polymorphism" of the libiscsi_auth_info
> struct 
> really starts to get used, this is why python code simply should not
> override 
> native code, in this case there is a one on one mapping between python
> 
> attributes and structure members, that is not always necessary the
> case, in 
> sometimes parts of the structure may be opaque, in which case your
> solution 
> simply will not work.

But, your code uses native C structure in an object, which doesn't hold it. This will become problem immediately when somebody does anything pythonish. You cannot create module for a language and expect people to not use it's features.

Create better encapsulation, using some form of dictionary if you wish, so the code gets simplier, just do not work with C internals of an object in different object.

> As I understand this is something which has been widely discussed in
> python 
> land in general, and there is no consensus. As such I'm going to keep
> things 
> doing my way, esp as when it comes to code less is more.

This is discussion was only about the isinstance call, the rest is problem everywhere

Martin

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux