These are chat archives for frictionlessdata/chat

16th
May 2016
roll
@roll
May 16 2016 07:00
@sirex for testing purposes storage._Storage__connection
sirex
@sirex
May 16 2016 07:22
From PEP-8: „Use one leading underscore only for non-public methods and instance variables. [...] To avoid name clashes with subclasses, use two leading underscores to invoke Python's name mangling rules. [...] Not everyone likes name mangling. Try to balance the need to avoid accidental name clashes with potential use by advanced callers.“.
sirex
@sirex
May 16 2016 07:49
@rgrp thanks for adding csv dialect support. As I understand this is not live yet?
sirex
@sirex
May 16 2016 07:54
We are planning to use datapackage.json for all open data provided by Vilnius municipality (Vilnius is the capital of Lithuania) and http://data.okfn.org/tools/view would be used as a frontend for available datasets.
Paul Walsh
@pwalsh
May 16 2016 08:08
TBH I am not a fan of double underscores either. They are not that commonly used. However, from what I see, the usage by @roll is fine according to PEP-8, if not that idiomatic in the real world. @sirex I'm not sure it would warrant changing, but I am interested in where the annoyance lies.
sirex
@sirex
May 16 2016 08:20
When I was experimenting with jsontableschema-sql-py I was surprised, that I can't reuse Storage attributes and methods and I didn't figure out myself, that I can access them as @roll suggested. So I ended up reinitializing everything in a Storage wrapper: https://gist.github.com/sirex/5e1ceac90bf473f42f3904889992b8fd#file-test_sync-py-L39-L52
Next time I will use storage._Storage__connection :+1:
roll
@roll
May 16 2016 13:09
Also not a fun of python mugling thing. But there is problem with using _xxx- for many programmers it could be an indication of subclassing API. Because it's common for protected (subclassing API) attributes in many languages. But for example as sql driver author I expect no one will use this internal thing because I could change anything inside this black box without any notification. Even broken gist is not good. But someone could write an actual extention using _xxx. So it leads to problems, stack fragility and uncertainty of API. So based on a lean api principle I don't see a peoblem with this two underscore thing because it's not really for any usage outsade a class.
roll
@roll
May 16 2016 13:14
It's like it just doesn't exist for anyone outside Storage. So thing is not coupled with its clients.
sirex
@sirex
May 16 2016 14:03
Thanks @roll after your explanation, now it makes sense.
Paul Walsh
@pwalsh
May 16 2016 14:04
@roll great explanation, thank you.