🔥 Burn Fat Fast. Discover How! 💪

L̶u̵m̶i̵n̷o̴u̶s̶m̶e̵n̵B̶l̵o̵g̵

Logo of telegram channel iamluminousmen — L̶u̵m̶i̵n̷o̴u̶s̶m̶e̵n̵B̶l̵o̵g̵ L
Logo of telegram channel iamluminousmen — L̶u̵m̶i̵n̷o̴u̶s̶m̶e̵n̵B̶l̵o̵g̵
Channel address: @iamluminousmen
Categories: Technologies , Blogs
Language: English
Subscribers: 335
Description from channel

(ノ◕ヮ◕)ノ*:・゚✧ ✧゚・: *ヽ(◕ヮ◕ヽ)
helping robots conquer the earth and trying not to increase entropy using Python, Big Data, Machine Learning
http://luminousmen.com
License: CC BY-NC-ND 4.0

Ratings & Reviews

2.50

2 reviews

Reviews can be left only by registered users. All reviews are moderated by admins.

5 stars

0

4 stars

0

3 stars

1

2 stars

1

1 stars

0


The latest Messages 6

2021-04-09 16:16:00 A function can have two returns called. For example:

def foo():
try:
return 1
finally:
return 2

2 will be returned here.

#python
190 views13:16
Open / Comment
2021-04-08 19:19:00 Just like tail recursion in Python, Guido wanted to avoid getting lambda functions in the language. The lambda function is just sort of syntactic sugar. It creates an unnamed function - that's literally it. There is no magic to it.

Those two are equivalent:

foo = lambda x: x * 2

def foo(x):
return x * 2
foo.__qualname__ = ''

We all know the lambda functions were introduced in the language, but there was a long fight behind it, which Guido did not win. Lambda still exists because it is extremely convenient and nothing else.

#python
191 views16:19
Open / Comment
2021-04-08 16:16:00 Python doesn't have tail recursion optimization, not because Guido couldn't handle it, but because he doesn't want to overcomplicate things.

If you really want to, you can implement a Y-combinator with optimization and use it.

#python
168 views13:16
Open / Comment
2021-04-07 16:16:01 The list may contain itself. Python detects this and does not loop in the output.

>>> a = []
>>> a.append(a)
>>> a
[[...]]

#python
180 views13:16
Open / Comment
2021-04-06 19:19:00 In Python if there are no references to the object, it is destroyed immediately, instead of waiting for garbage collection. GC is needed for complicated cases when we have cyclic references.

#python
179 views16:19
Open / Comment
2021-04-06 16:16:00 The popular method to declare an abstract method in Python is to use NotImplentedError exception:

def func(self):
raise NotImplementedError

Though it's pretty popular and even has IDE support (Pycharm considers such a method to be abstract) this approach has a downside. You get the error only upon method call, not upon class instantiation.

Use abc module to avoid this problem:

from abc import ABCMeta, abstractmethod
class Service(metaclass=ABCMeta):
@abstractmethod
def func(self):
pass

#python
175 views13:16
Open / Comment
2021-04-05 19:19:00 There is a common misconception that GIL was invented to protect developers from problems with concurrent access to data. But this is not true.

GIL, of course, will prevent you from parallelizing an application using threads (but not processes). Simply put, GIL is a lock that must be taken before any access to Python (not that important if Python code is executing or calls using Python C API). Therefore, GIL will protect internal structures from non-consistent states, but you will have to use synchronization primitives like in any other language.

#python
172 views16:19
Open / Comment
2021-04-05 16:16:00 And this week we're gonna talk about a hobby project Van Rossum did over Christmas break 1989. Yep, it's Python. Again, nothing specific, just some rambling about the topic, should be interesting though.
170 views13:16
Open / Comment
2021-04-01 16:16:00 Most of the major roadblocks I ran into were not technical, they were communicative. Sure, there were always technical challenges but that’s the role of an engineer, to fix the technical challenges. Never underestimate the importance of communication, internal and external. There’s nothing worse than solving a technical challenge when it was the wrong technical challenge to be solved.

#soft_skills
238 views13:16
Open / Comment
2021-03-29 16:16:00 This time we gonna talk about pizza and ML

https://luminousmen.com/post/machine-learning-types
280 views13:16
Open / Comment