|
pokeyman posted:I’m sorry this is happening to you, but I’m not sorry I get to read about it here
|
# ? Mar 11, 2019 05:13 |
|
|
# ? Apr 27, 2024 19:15 |
|
not because of what you did but the inevitable legislative response my C++ knowledge is about 15 years out of date. getters and setters are bad now and new/delete is considered harmful? my god
|
# ? Mar 11, 2019 07:53 |
|
GNU Order posted:Interesting choice but whatever helps. Personally I just get horny waiting for my builds to finish not as horny as my autocorrect it seems!
|
# ? Mar 11, 2019 10:22 |
|
whats the preferred documentation system for python? there seem to be a bunch of standards for docstrings :| https://realpython.com/documenting-python-code/#docstring-formats https://realpython.com/documenting-python-code/#documentation-tools-and-resources
|
# ? Mar 11, 2019 12:11 |
|
I thought you just wrote something and the dynamic nature of python would detect it as documentation and label it as such
|
# ? Mar 11, 2019 12:19 |
|
Boiled Water posted:I thought you just wrote something and the dynamic nature of python would detect it as documentation and label it as such lol anyway seems sphinx is the go-to doc generator and pycharm supports a bunch of different formats so ill just blunder my way through it!
|
# ? Mar 11, 2019 12:33 |
|
ugh wtf is this poo poo, i hate path fuckery /usr/local/bin/python3 "/Applications/PyCharm CE.app/Contents/helpers/rest_runners/sphinx_runner.py" -b html /Users/Krankenstyle/dev/MyProject/module /Users/Krankenstyle/dev/MyProject/docs Fatal Python error: initfsencoding: unable to load the file system codec Traceback (most recent call last): File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/encodings/__init__.py", line 31, in <module> File "/Users/Krankenstyle/dev/MyProject/codecs.py", line 2, in <module> File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/logging/__init__.py", line 26, in <module> File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/traceback.py", line 5, in <module> File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/linecache.py", line 11, in <module> File "/usr/local/Cellar/python/3.7.2_2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tokenize.py", line 27, in <module> ImportError: cannot import name 'open' from 'builtins' (unknown location) Process finished with exit code 134 (interrupted by signal 6: SIGABRT)
|
# ? Mar 11, 2019 12:58 |
|
documentation?? what is that, anyway, here's my six nested list comprehensions
|
# ? Mar 11, 2019 12:59 |
|
floatman posted:gently caress r.e. my previous story of using a logging library (monolog, PHP) to generate statefully held html to output back to page. one of our guys does the same thing in his code except his max_debug equivalent is a define in one of his files somewhere so logging level is controlled by something not in the file you are expecting and you have to edit code to change it
|
# ? Mar 11, 2019 13:55 |
|
Krankenstyle posted:ugh wtf is this poo poo, i hate path fuckery hmm it seems my internal module files are shadowing the system modules (codecs.py, string.py) but ONLY when i run in pycharm... i tried refactoring codecs.py to codec.py and it got further but failed at string.py it works fine from the command line, what the hell ?!
|
# ? Mar 11, 2019 14:53 |
|
floatman posted:gently caress r.e. my previous story of using a logging library (monolog, PHP) to generate statefully held html to output back to page. seeing "if (max_debug)" is giving me PTSD
|
# ? Mar 11, 2019 14:54 |
|
lmao it was "add source roots to PYTHONPATH" in the run settings
|
# ? Mar 11, 2019 14:58 |
|
alright, so: can i avoid putting sphinx's index.rst inside my module? it looks ugly and id rather it was in docs/ next to conf.py...code:
code:
|
# ? Mar 11, 2019 15:44 |
Krankenstyle posted:lol yeah, sphynx on readthedocs is modus operandi for people who document their poo poo
|
|
# ? Mar 11, 2019 16:03 |
|
cinci zoo sniper posted:yeah, sphynx on readthedocs is modus operandi for people who document their poo poo cool. you know anything about my previous post about index.rst? do people normally just cram it in the module because ew ew ew
|
# ? Mar 11, 2019 16:15 |
Krankenstyle posted:cool. you know anything about my previous post about index.rst? do people normally just cram it in the module because ew ew ew no, people usually sphinx-quickstart and setup a root path for the documentation in ~/docs or ~/doc ("docs" or "doc" input value respectively). i haven't ever tried moving it, let me check separately
|
|
# ? Mar 11, 2019 16:28 |
honestly? not a single clue why you cant have it in MyProject/docs/ as described. i'd just regenerate sphinx at this point
|
|
# ? Mar 11, 2019 16:47 |
|
yea i thought it was supposed to go in docs/ but sphinx complains if its not in my module
|
# ? Mar 11, 2019 16:49 |
|
cinci zoo sniper posted:honestly? not a single clue why you cant have it in MyProject/docs/ as described. i'd just regenerate sphinx at this point lol gonna try rebuilding
|
# ? Mar 11, 2019 17:00 |
oh, one way to probably work around this is to do sys.path.append or sys.path.insert within conf.py, e.g. sys.path.insert(0, os.path.abspath('..'))
|
|
# ? Mar 11, 2019 17:14 |
|
ohhh thanks!!
|
# ? Mar 11, 2019 17:17 |
okay so then the sys.path part considering your project structure was equal to MyProject/MyModule/, as that is where __init__.py is
|
|
# ? Mar 11, 2019 17:30 |
|
cinci zoo sniper posted:okay so then the sys.path part considering your project structure was equal to MyProject/MyModule/, as that is where __init__.py is got it to work with sys.path.insert(0, os.path.abspath('..')) and then in index.rst a bunch of code:
whew, that was the hard part. now to actually write the documentation...
|
# ? Mar 11, 2019 18:52 |
|
TheFluff posted:
if my boss enforced a no listening to music/podcast policy while working I would quit on the spot lol
|
# ? Mar 11, 2019 18:56 |
|
why would python want to standardise on a single docstring format? TIMTOWTDI is in the zen now, right?
|
# ? Mar 11, 2019 19:55 |
|
argh anyone know if you can set a pubxml publish profile to "delete all files prior to publish except for a specific file"? you can set them to exclude from copy but I can't find any documentation on the delete sections or any actual documentation just fragments or "this feature is deprecated" pages
|
# ? Mar 11, 2019 20:16 |
|
Soricidus posted:why would python want to standardise on a single docstring format? TIMTOWTDI is in the zen now, right? thats perl python seems to be more like "idk just do whatever, who knows it might work??" e: or "just defer everything to runtime, gently caress you"
|
# ? Mar 11, 2019 21:26 |
|
Krankenstyle posted:thats perl
|
# ? Mar 11, 2019 21:32 |
|
Luigi Thirty posted:getters and setters are bad now C++ doesn't have those, are you referring to making member variables public? Luigi Thirty posted:and new/delete is considered harmful? they always were harmful, the difference is that we have realistic alternatives now
|
# ? Mar 12, 2019 00:35 |
|
hackbunny posted:C++ doesn't have those, are you referring to making member variables public? kinda but is there any reason besides cargo culting to implement trivial (i.e. not factories and such) getters and setters even in say Java? I suppose if you use an interface type in the signature e: i've seen python getters and setters used for runtime evaluation shenanigans, but that's not really a good argument in favour Private Speech fucked around with this message at 01:42 on Mar 12, 2019 |
# ? Mar 12, 2019 01:37 |
|
They give you the option of adding logic later on without needing to refactor callers.
|
# ? Mar 12, 2019 01:49 |
|
duz posted:one of our guys does the same thing in his code except his max_debug equivalent is a define in one of his files somewhere 1. There is a massive PHP file which contains nothing but global string definitions 2. The definition names are things like MANUAL_PREFIX ( which are strings which contain a period at the end e.g. "DERPPREFIX.") and definitions like OPERATION_SUFFIX 3. To initialise a monolog logger, you need to provide a channel name. This guy initialises loggers using a concatenated pair of prefix and suffix definitions e.g new logger(MANUAL_PREFIX . OPERATION_SUFFIX); 4. At points in the code, the class that calls the logger will retrieve the logger name. 5. It then does a string split based on period (.) To return a array of strings with a count of 2. 6. It then checks if strings[0] == SOME_PREFIX 7. If the strings match, the class, which contains application logic, will alter behavioral based on the name of the current logger its using. So over here, logging level and application logic are controlled by something not in the file you are expecting and you have to edit code to change it.
|
# ? Mar 12, 2019 04:43 |
|
Jabor posted:They give you the option of adding logic later on without needing to refactor callers. I guess it makes sense, particularly when java doesn't let you override member access with a function looking around a lot of people don't like it though, including the isocpp comittee itself, arguing that a) you are breaking encapsulation by exposing members marked private, and b) if you add logic you might want to refactor the callers anyway, since the class could now behave differently than the callers expect (e.g. you fire off an event on modifying some value, but a caller uses it for an algorithm which calls it thousands of times per millisecond) e: here's a summary of stroustrups/isocpp conclusions on the topic isocpp posted:C.131 Avoid trivial getters and setters Private Speech fucked around with this message at 06:06 on Mar 12, 2019 |
# ? Mar 12, 2019 05:43 |
|
floatman posted:Lmao do we work with the same guy? holy poo poo lmao
|
# ? Mar 12, 2019 05:58 |
|
Private Speech posted:I guess it makes sense, particularly when java doesn't let you override member access with a function this argument has always seemed like a bunch of fart huffing by smalltalk worshipers quote:and b) if you add logic you might want to refactor the callers anyway, since the class could now behave differently than the callers expect (e.g. you fire off an event on modifying some value, but a caller uses it for an algorithm which calls it thousands of times per millisecond) that would be a reasonable argument if java had a way to declare a variable as non-null and have that verified by the type checker it does not also I’m not particularly interested in soustrops, or the c++ committee’s, thoughts on what makes code understandable, I’ve seen to much of the c++ standard library for that
|
# ? Mar 12, 2019 06:05 |
|
hackbunny posted:C++ doesn't have those, are you referring to making member variables public? yeah it was dogmatic that you NEVER MAKE MEMBER VARIABLES PUBLIC because OOP ENCAPSULATION RAAAARGH
|
# ? Mar 12, 2019 06:11 |
|
Luigi Thirty posted:yeah it was dogmatic that you NEVER MAKE MEMBER VARIABLES PUBLIC because OOP ENCAPSULATION RAAAARGH it's an opinion that seems 100% correct to me except in the context of fascist-objectivist languages where everything-is-an-object. if you're in java or ruby or (i think) python where there is no way to express a simple immutable datatype, you're god damned right i'm going to have trivial getters and setters. but in a good language where you can have simple data types with typed field access then i can't imagine why you would need trivial getters and setters in your actual objects.
|
# ? Mar 12, 2019 06:36 |
|
DONT THREAD ON ME posted:it's an opinion that seems 100% correct to me except in the context of fascist-objectivist languages where everything-is-an-object. if you're in java or ruby or (i think) python where there is no way to express a simple immutable datatype, you're god damned right i'm going to have trivial getters and setters. as long as you can transparently substitute an accessor for the typed field access, sure if your language can't do that, you can be sure that your business requirements will suddenly change to require you to touch the new foo.last_updated field every time you change the value of foo.butt but if, as you suggest, your types are immutable, then yea you might be okay
|
# ? Mar 12, 2019 06:53 |
|
this is C++ for my mastodon client so
|
# ? Mar 12, 2019 07:01 |
|
|
# ? Apr 27, 2024 19:15 |
|
ComradeCosmobot posted:as long as you can transparently substitute an accessor for the typed field access, sure yeah i mean there are a lot of ways to do encapsulation, it's not just objects. package, module, whatever. you can use these to control mutable field access. more tangibly: say i have a package, intestines, that contains a struct, colon, that has a field, []poop. i can say that colon is a public type, but access to the field []poop is private to members of intestines. things defined in intestines are free to modify poop with an understanding of its important semantics, but other packages only see colon as a simple immutable data type with no fields. if they want to extract a []poop from a colon, they need to access it with the getPoop(colon) -> []poop method defined in intestine. you can dress this up in a bunch of ways that are basically just object oriented programming as it is popularly defined. DONT THREAD ON ME fucked around with this message at 07:10 on Mar 12, 2019 |
# ? Mar 12, 2019 07:08 |